每当我尝试运行 nodemon 来自动重启我的本地服务器(在端口 3000 上运行)时,我都会收到此错误消息,关于 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)
有任何解决这个问题的方法吗?
最佳答案
据我所知
Async Await is not available in node v6.5.0,
您正在使用的。所以你可以升级你的 Node 版本,或者可以开始使用具有相同版本 Node 的 Promise 对象。
关于javascript - 如何修复 Nodemon "async remove {}"语法错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59363182/