[英]nodemon command not recognized by terminal
I am trying to automate the server reload using the nodemon.我正在尝试使用 nodemon 自动重新加载服务器。 I have it installed locally and have the start set to
我已在本地安装它并将开始设置为
nodemon app.js
using the code: nodemon app.js
使用代码:
"scripts": { "start": "nodemon app.js" }
It ran fine for the first time, but after shutting down the system once and reopening my project, it does not seem to run properly anymore.第一次运行良好,但关闭系统一次并重新打开我的项目后,它似乎不再正常运行。 Now it throws an error every time I use the command
nodemon app.js
.现在每次我使用命令
nodemon app.js
都会引发错误。
The error line is:错误行是:
nodemon: The term 'nodemon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The best solution I could go about this is:我可以解决的最佳解决方案是:
npm install -D nodemon // install as a dev dependency
npm start // run script start
Below are some solutions下面是一些解决方案
npm install -g nodemon
after that you have to run this command: npm run dev
here dev is (script) server name之后你必须运行这个命令:
npm run dev
here dev is (script) server name
npm config get prefix
in output you will get PATH and then past this path in to the Environment Variables and it solved在 output 中,您将获得 PATH ,然后通过此路径进入环境变量并解决
Restart the terminal and run this command重新启动终端并运行此命令
nodemon run dev
I hope after that it will work properly:)我希望之后它会正常工作:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.