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
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.
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.