John Doe John Doe - 10 months ago 60
Node.js Question

Node.js: How to set npm start?

I tried to use

npm start
to start my application. So I added the following line in my package.json file:

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

however, when I used
npm start
, I met with this problem:
enter image description here

but when I used
node app.js
, it worked. So what's the problem?

Answer Source

Does it work if you use the command npm run start instead of npm start?