[英](Windows) How to fix nodemon | Node.js
So I started using nodemon
a while ago and started to use it again recently.所以我前一阵子开始使用nodemon
,最近又开始使用它。 But I got an error from the VS-Code command line:但是我从 VS-Code 命令行得到一个错误:
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.
At line:1 char:1
+ nodemon
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (nodemon:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
This basically means it isn't a command, similar thing would happen in an actual cmd.这基本上意味着它不是命令,类似的事情会发生在实际的 cmd 中。
Edit: I made this Q&A just for some people who have this same problem.编辑:我为一些有同样问题的人做了这个问答。
So I started using nodemon
a while ago and started to use it again recently.所以nodemon
开始用nodemon
,最近又开始用了。 But I got an error from the VS-Code command line:但是我从 VS-Code 命令行收到错误消息:
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.
At line:1 char:1
+ nodemon
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (nodemon:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
This basically means it isn't a command, similar thing would happen in an actual cmd.这基本上意味着它不是命令,类似的事情会发生在实际的 cmd 中。
Edit: I made this Q&A just for some people who have this same problem.编辑:我为一些有同样问题的人做了这个问答。
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 like之后你必须运行这个命令: npm run dev
here dev is (script) server name like
{
"main": "app.js",
"scripts": {
"dev": "nodemon app.js"
},
}
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.