我通过在全球范围内安装它们来逐一尝试这三种方法。 但似乎没有工作。 当我进行任何更改时,我正在使用它们自动重启服务器。
以下是我正在使用的命令。
nodemon npm start
forever npm start
supervisor npm start
主管错误
Error: Cannot find module 'E:\d v\MEAN Lynda - Developing for the MEAN Stack and
MongoDB\projects\project\start'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:142:18)
at node.js:939:3
Program node start exited with code 1
Starting child process with 'node start'
module.js:341
throw err;
^
永远错误
E:\d v\MEAN Lynda - Developing for the MEAN Stack and MongoDB\projects\project>f
orever npm start
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up f
or at least 1000ms
error: Cannot start forever
error: script E:\d v\MEAN Lynda - Developing for the MEAN Stack and MongoDB\pr
ojects\project\npm does not exist.
答案 0 :(得分:1)
you should check the package.json file where you have properly assigned the value of "start" key or not. Forever and supervisor are used as follows. you can always type and check that using :
forever -h
supervisor -h
you will find the following output as examples of using supervisor:
Examples:
supervisor myapp.js
supervisor myapp.coffee
supervisor -w scripts -e myext -x myrunner myapp
supervisor -- server.js -h host -p port
forever is used as follows:
forever start app.js