npm ERR! missing script: start

0

I'm having this error while trying to start a vue-cli. The installation ran smoothly:

villas:vue villas$ npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/villas/.npm/_logs/2017-08-25T00_39_17_837Z-debug.log

And there in the log file:

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:151:19)
4 verbose stack     at /usr/local/lib/node_modules/npm/lib/run-script.js:61:5
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:114:5
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:401:5
4 verbose stack     at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:356:45)
4 verbose stack     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:399:3)
4 verbose stack     at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:159:5)
4 verbose stack     at ReadFileContext.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:331:20)
4 verbose stack     at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16)
4 verbose stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:366:13)
5 verbose cwd /Users/villas/Sites/vue
6 verbose Darwin 16.7.0
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
8 verbose node v6.11.2
9 verbose npm  v5.3.0
10 error missing script: start
11 verbose exit [ 1, true ]
    
asked by anonymous 25.08.2017 / 02:47

1 answer

0
  

npm ERR! missing script: start

This error occurs if you did not define the package.json script in the start file, eg:

  "scripts": {
    // Adicione essa linha, mas pode ser também ex = "start: "node index.js"
    "start": "vue init",
    "test": "echo "Error: no test specified" && exit 1"
  },
  

I recommend reading package.json understanding the scripts article written by: W illiam B runo

    
25.08.2017 / 05:08