How to solve: npm run build / dev: missing script?

I am trying to start a node, but for some reason local installation of npm node does not work.

Package is:

$ npm run dev npm ERR! Darwin 15.4.0 
npm ERR! argv "/usr/local/Cellar/node/5.6.0/bin/node" "/usr/local/bin/npm" "run" "jshint" 
npm ERR! node v5.6.0 
npm ERR! npm  v3.6.0
npm ERR! missing script: dev 
npm ERR!  
npm ERR! If you need help, you may report this error at: 
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request: 
npm ERR!     /Users/me/workspace/testapp/npm-debug.log

I can work with npm install, but run npm devnot correctly.

+10
source share
1 answer

You saw this error because there probably wasn’t a script named dev in the "scripts" section of your package.json

npm installand npm run dev- two completely different ideas

  • npm install will be executed through the dependency section of package.json and selecting / installing modules in this list

  • npm run dev package.json "dev", script "dev", , (, Dev , - , .)

package.json

{
  "name": "testapp",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "dev": "echo This is the DEV script",
    "abc": "echo This is the abc script",
    "xyz": "echo This is the xyz script",
    "start":"echo This is the special start script"
  }
}

, cd , package.json, , :

npm run dev, " dev script"

npm run abc scree " abc script"

npm run xyz " xyz script"

npm run linkxu1989 , , script "linkxu1989" package.json

npm start " script" ( , start - . npm start npm run start,

: "scripts" package.json npm run SCRIPT_NAME

, NPM!

.

+19

Source: https://habr.com/ru/post/1663383/


All Articles