如何修复Nodemon“异步删除{}";语法错误? [英] How to fix Nodemon "async remove {}" syntax error?

查看:58
本文介绍了如何修复Nodemon“异步删除{}";语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试运行nodemon来自动重新启动本地服务器(在端口3000上运行)时,都会收到有关no中语法错误的错误消息

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?

推荐答案

据我所知

异步等待在节点v6.5.0中不可用,

Async Await is not available in node v6.5.0,

您正在使用的.因此,您可以升级节点版本,或者可以将Promise对象与相同版本的节点一起使用.

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

这篇关于如何修复Nodemon“异步删除{}";语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆