[Solved] npm ERR! missing script: start

While are you trying to debug your node application using the npm start command. Then you will face npm ERR! missing script: start, This error.

In this article, you’ll learn everything about this npm ERR! missing script: start Error in nodeJs. And how to resolve the error all the possible solutions with examples.

How to npm ERR! missing script: start Error Occurs?

Most of the time you get this error while Missing a start script in the scripts section of your package.json file. then you will face this error.

npm ERR! missing script: start

How To Fix npm ERR! missing script: start Error?

There are different ways to fix npm ERR! missing script: start this error. Let us take a look at every solution.

  • How To Fix npm ERR! missing script: start Error?

To solve this npm ERR! missing script: start Error You might not define start script from your package.json file. So, you just need to add start command to the scripts object in your package.json file. Now I hope your error will be solved.

  • npm ERR! missing script: start

Sometime you get this error for duplicate scripts section in the package.json file. When you have more than one scripts section, then npm will read only latest entry. To solve this error. So, You have to first merge the two scripts section as one. Now i hope your error will be gone.

Solution 1: add start script in your package.json

To solve this error You just add a start command in the scripts object of your package.json file like this below.

{
  "scripts": {
    "start": "node index.js",
  }
}

Now, I hope this solution work to solve this error.

Solution 2: duplicate scripts section

There are two scripts section in the example below:

{
  "name": "v-app",
  "version": "1.0.0",
  "scripts": {
    "start": "node index.js"
  },
  "scripts": {
    "dev": "gulp"
  }
}

To resolve this issue, you need to merge the two scripts section as one:

{
  "name": "v-app",
  "version": "1.0.0",
  "scripts": {
    "start": "node index.js",
    "dev": "gulp"
  }
}

Now your error will be gone.

Conclusion

In this article, we have discussed what causes the error and we have discussed ways to fix the error.

we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Categories