简体   繁体   English

Node.js:如何设置npm启动?

[英]Node.js: How to set npm start?

I tried to use npm start to start my application. 我试图使用npm start启动我的应用程序。 So I added the following line in my package.json file: 因此,我在package.json文件中添加了以下行:

  "scripts": {
    "start": "node app.js"
  }

however, when I used npm start , I met with this problem: 但是,当我使用npm start ,遇到了以下问题: 在此处输入图片说明

but when I used node app.js , it worked. 但是当我使用node app.js ,它可以工作。 So what's the problem? 所以有什么问题?

使用命令npm run start而不是npm start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM