Node -npm start npm ERR! missing script: start


Hello, I'm using Node to make a RESTFUL API. I just found out that now npm uses package-lock.json and I do not know if this changes the way you work with node ... this is my error and my code

var express = require('express')
var app = express()

app.get('/', function (req, res) {
  res.send('Hello World')


asked by E.Rawrdríguez.Ophanim 02.02.2018 в 18:15

2 answers


I just added this to the package.json and magic pum.

"scripts": {
    "start": "node tu-script-main.js"
answered by 02.02.2018 / 19:19

The error may be caused by executing "npm start app" which makes node is to go to the package.json file to the "scripts" section and execute the key containing "start", as indicated by the Node documentation:


What you are going through after "start" are arguments for the commands that you have defined in the "start" section

I recommend this post (if you want to do it with npm start): link

If you only want to run without configuring it directly, it would be:

node app.js

I hope I helped you with your question

answered by 02.02.2018 в 19:27