Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let exec = require('child_process').exec;
- exec(`node ./node_modules/mongodb-migrate -runmm -dbc '{"host":"localhost","db":"myDb","port":27017,"username":"user1","password":"pswd1"}' up`,
- (error, stdout, stderr) => {
- if (error) {
- console.error(`exec error: ${error}`);
- return;
- }
- console.log(`${stdout}`);
- console.log(`${stderr}`);
- });
- exec error: Error: Command failed: node ./node_modules/mongodb-migrate -runmm -dbc '{"host":"localhost","db":"myDb","port":27017,"username":"user1","password":"pswd1"}' up
- undefined:1
- '{host:localhost,db:myDb,port:27017,username:user1,password:pswd1}'
- ^
- SyntaxError: Unexpected token h in JSON at position 0
Add Comment
Please, Sign In to add comment