Node.js: 如何设置 npm 启动?
Node.js: How to set npm start?
我尝试使用 npm start
来启动我的应用程序。所以我在 package.json 文件中添加了以下行:
"scripts": {
"start": "node app.js"
}
然而,当我使用npm start
时,我遇到了这个问题:
但是当我使用 node app.js
时,它起作用了。那么问题是什么?
使用命令 npm run start
而不是 npm start
。
我尝试使用 npm start
来启动我的应用程序。所以我在 package.json 文件中添加了以下行:
"scripts": {
"start": "node app.js"
}
然而,当我使用npm start
时,我遇到了这个问题:
但是当我使用 node app.js
时,它起作用了。那么问题是什么?
使用命令 npm run start
而不是 npm start
。