Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Nodemon "async remove {}" syntax error?

Whenever I try to run nodemon to auto-restart my local server (running on port 3000), I get this error message regarding a syntax error in the no

/Users/SI23/.nvm/versions/node/v6.5.0/lib/node_modules/nodemon/node_modules/chokidar/index.js:151
  async remove(item) {
        ^^^^^^
SyntaxError: Unexpected identifier
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:528:28)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/SI23/.nvm/versions/node/v6.5.0/lib/node_modules/nodemon/lib/monitor/watch.js:6:16)
    at Module._compile (module.js:556:32)

Any way to fix this?

like image 403
SI23 Avatar asked Dec 16 '19 19:12

SI23


2 Answers

As per my knowledge

Async Await is not available in node v6.5.0,

which you are using. So you can upgrade your node version or can start using Promise object with the same version of node.

like image 122
Abhijit Padhy Avatar answered Nov 12 '22 00:11

Abhijit Padhy


In my case, npm list chokidar helped me realize it was another module (gulp-nodemon) that used a newer version of chokidar. It worked after downgrading it.

like image 2
moyez Avatar answered Nov 12 '22 02:11

moyez