我在节点应用程序中有gruntfile(节点版本-4.2.2,npm版本 - 2.14.7),如下所示:
// watch node server for changes
nodemon: {
default: {
script: 'server.js'
}
},
运行命令grunt
会抛出错误,如下所示:
[nodemon] starting `node server.js`
Debugger listening on port 5858
module.js:339
throw err;
^
Error: Cannot find module 'C:\workspace\start.js'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
[nodemon] app crashed - waiting for file changes before starting...
我在app root上有gruntfile.js和server.js文件,如下所示:
C:\workspace\myApp
- gruntfile.js
- server.js
如果我在grunfile.js中更改脚本文件路径,如下所示:
// watch node server for changes
nodemon: {
default: {
script: 'myApp/start.js'
}
},