我正在通过 YouTube 教程学习 Node。有一次老师为了自动启动
node server
而安装了nodemon。一切都应该如此,但我的代码仍然没有自动更新。
操作系统 Ubuntu 22.04,IDE VSCode
这是我的 package.json
{
"name": "devops_with_node_n_express",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node index.js",
"dev": "nodemon -L index.js"
},
"keywords": \[\],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
},
"devDependencies": {
"nodemon": "^2.0.22"
}
}
这是正在运行的nodemon
DevOps_with_Node_n_Express$ nodemon index.js
\[nodemon\] 2.0.22
\[nodemon\] to restart at any time, enter `rs`
\[nodemon\] watching path(s): *.*
\[nodemon\] watching extensions: js,mjs,json
\[nodemon\] starting `node index.js`
listening on port 3600
\[nodemon\] restarting due to changes...
\[nodemon\] starting `node index.js`
listening on port 3600
Help will be deeply appricated
我已经检查并安装了 nodemon 并通过发出
npm list
正常工作,这导致
DevOps_with_Node_n_Express$ npm list
[email protected] /home/hardstone/Documents/2-Dockers_and_Conatiners_Resources/DevOps_with_Node_n_Express
├── [email protected]
└── [email protected]