Nodemon不会自动重新启动
我已经安装了Nodemon(到项目目录或全球),但是当我对代码进行更改并保存时,它不会自动重新启动。 VS代码中的终端显示“ [nodemon]由于更改而重新启动...”,但是当我保存更改时,它才会停留在那里。
曾尝试过不同版本的nodemon并重新安装我的nodejs,但仍然不起作用。
这是我的包装。JSON和目录:
.. \ mainfolder \ signitment_1 \ package.json
.. \ mainfolder \ signitment_1 \ app.js
{
"name": "assignment_1",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon app.js"
},
"author": "user1",
"license": "ISC",
"dependencies": {
"express": "^4.18.1"
},
"devDependencies": {
"nodemon": "^2.0.18"
}
}
I have installed nodemon (onto to project directory or globally) but it does not auto restart when I make changes to my code and save it. The terminal in vs code shows '[nodemon] restarting due to changes...' but it just stuck there when I saved my changes.
Had tried different versions of nodemon and reinstall my nodejs but still doesn't work.
This is my package.json and the directory:
..\mainfolder\Assignment_1\package.json
..\mainfolder\Assignment_1\app.js
{
"name": "assignment_1",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon app.js"
},
"author": "user1",
"license": "ISC",
"dependencies": {
"express": "^4.18.1"
},
"devDependencies": {
"nodemon": "^2.0.18"
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于像我这样的Windows用户,我在用户变量中添加了Path变量的以下值:
重新启动与代码,对我有用!
For Windows users like me, I have added in User Variable the following value for PATH variable:
Restarts VS code and it works for me!