Source:  Twitter logo

I'm trying to run this example. I have these errors when I start running it:

npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:

npm ERR!/home/username/.npm/_logs/2018-04-15T09_19_49_453Z-debug.log

any help?

You should add start script to the package.json:

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

Also, you can run your app without a script just by running the following command:

$ node index.js
2 users liked answer #0dislike answer #02
Soroush Chehresa profile pic
Soroush Chehresa

It looks like there is no start command in scripts i.e in your package.json file. Below is the start command you need to add to your scripts in package.json file, if it is not available.

"scripts": {
    "start": "node your-script.js"
}

Or you could directly run the following command

node your-script.js

This error can also occur if there is a second entry of script key in your package.json file, try removing the second entry and run it works.

0 users liked answer #1dislike answer #10
Alekya profile pic
Alekya

As above, make sure that you have your start scripts.

"scripts": {
"start": "node ./examples/app.js",
"test": "echo \"Error: no test specified\" && exit 1"
 }

Also, make sure that you are in the correct client side of the application when running npm start.

-1 users liked answer #2dislike answer #2-1
Tray Fleary profile pic
Tray Fleary

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).