Guest User

Untitled

a guest
Dec 15th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. let exec = require('child_process').exec;
  2. exec(`node ./node_modules/mongodb-migrate -runmm -dbc '{"host":"localhost","db":"myDb","port":27017,"username":"user1","password":"pswd1"}' up`,
  3. (error, stdout, stderr) => {
  4. if (error) {
  5. console.error(`exec error: ${error}`);
  6. return;
  7. }
  8. console.log(`${stdout}`);
  9. console.log(`${stderr}`);
  10. });
  11.  
  12. exec error: Error: Command failed: node ./node_modules/mongodb-migrate -runmm -dbc '{"host":"localhost","db":"myDb","port":27017,"username":"user1","password":"pswd1"}' up
  13. undefined:1
  14. '{host:localhost,db:myDb,port:27017,username:user1,password:pswd1}'
  15. ^
  16.  
  17. SyntaxError: Unexpected token h in JSON at position 0
Add Comment
Please, Sign In to add comment