我在WebStorm中的配置如下:
并且失败
[nodemon] 1.18.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `babel-node server.js`
[nodemon] unable to run executable: "babel-node"
[nodemon] Error
at Bus.utils.bus.on (/Users/SOME_PATH_TO_PROJECT/node_modules/nodemon/lib/nodemon.js:156:25)
at Bus.emit (events.js:202:15)
at ChildProcess.<anonymous> (/Users/SOME_PATH_TO_PROJECT/node_modules/nodemon/lib/monitor/run.js:143:9)
at ChildProcess.emit (events.js:197:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12)
at onErrorNT (internal/child_process.js:427:16)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
在全局和本地(node_modules)都安装了最新的@babel/node
纱线:
$ which babel-node
/usr/local/bin/babel-node
还尝试给出绝对babel-node
路径和相对本地路径(以node_modules为目标)。没有运气。
您知道WebStorm为什么无法执行已安装的babel-node
吗?不用说,它可以在终端中运行。