Reputation: 39
I'm receiving this error when trying to run my node application using the npm start command on Visual Studio Code. Any help is greatly appreciate!
This is what is inside my package.json file:
{
"name": "bloggin-site",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "nodemon server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"express-fileupload": "^1.2.1",
"express.js": "^1.0.0",
"nodemon": "^2.0.15"
}
}
This is the message on terminal when I run the code:
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wendyb/.npm/_logs/2021-12-06T06_01_12_013Z-debug.log```
This is what the debug log says:
```0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: start
4 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:5
4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:436:5
4 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:391:45)
4 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:434:3)
4 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:161:5)
4 verbose stack at ReadFileContext.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:350:20)
4 verbose stack at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16)
4 verbose stack at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:281:13)
5 verbose cwd /Users/wendyb/Desktop/Final
6 verbose Darwin 19.6.0
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
8 verbose node v14.18.1
9 verbose npm v6.14.15
10 error missing script: start
11 verbose exit [ 1, true ] ```
Upvotes: 2
Views: 469
Reputation: 11
Maybe just check if you have defined correct path for your server.js file if not correct it and try or maybe just in case the changes you made in package.json file and haven't saved it just save it and try again
for more help you can refer this link
Upvotes: 1