2

I am getting the following error:

npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\..\AppData\Roaming\npm-cache\_logs\2019-04-27T18_02_39_6
60Z-debug.log

This is what I am doing - In my package.json I have written the following code:

{
"name":"javaScript-blockchain",
    "version":"1.0.0",
    "description":"",
    "main":"index.js",
    "scripts": {
        "test":"echo \"Error:no test specified\" && exit 1",
        "start":"node dev/api.js"
    }
    "author":"Samrat Roy Chowdhuri",
    "license":"ISC",
    "dependencies":{
        "express":"^4.16.3",
        "nodemon":"^1.17.3",
        "sha256":"^0.2.0"
    }
}

Then in my Node prompt I run npm start and get the above error

In the log the following is mentioned:


0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: start
4 verbose stack     at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack     at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:63:5
4 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:418:5
4 verbose stack     at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:373:45)
4 verbose stack     at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:416:3)
4 verbose stack     at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack     at ReadFileContext.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:332:20)
4 verbose stack     at ReadFileContext.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
5 verbose cwd E:\programs\blockchain
6 verbose Windows_NT 6.1.7601
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
8 verbose node v10.15.3
9 verbose npm  v6.4.1
10 error missing script: start
11 verbose exit [ 1, true ]

Please suggest where I am going wrong

8
  • 2
    Did you try npm run start? Commented Apr 27, 2019 at 18:06
  • 1
    Did you run npm start in the same folder as the package.json? Commented Apr 27, 2019 at 18:07
  • @MaazSyedAdeeb yes, in the same directory Commented Apr 27, 2019 at 18:11
  • @AnuragSrivastava yes tried that, same result Commented Apr 27, 2019 at 18:12
  • do you try to run this on an external harddrive? Commented Apr 27, 2019 at 18:14

1 Answer 1

1

Your JSON is invalid. you just need a comma after the script curly bracket which is just after the start script

{
"name":"javaScript-blockchain",
    "version":"1.0.0",
    "description":"",
    "main":"index.js",
    "scripts": {
        "test":"echo \"Error:no test specified\" && exit 1",
        "start":"node dev/api.js"
    },
    "author":"Samrat Roy Chowdhuri",
    "license":"ISC",
    "dependencies":{
        "express":"^4.16.3",
        "nodemon":"^1.17.3",
        "sha256":"^0.2.0"
    }
}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.