Skip to content

Instantly share code, notes, and snippets.

@Gyumeijie
Last active February 28, 2018 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gyumeijie/6fa83ca9fbc264c45cb15e189f642ae5 to your computer and use it in GitHub Desktop.
Save Gyumeijie/6fa83ca9fbc264c45cb15e189f642ae5 to your computer and use it in GitHub Desktop.
npm
npm run-script <command> [--silent] [-- <args>...] alias: npm run
Given the following package.json snippet:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "babel src -d dist",
"run": "node dist/main.js"
}
To run 'build', we should use `npm run-script build`, but not `npm build`,
npm build is a npm cli command and if we want to run 'run', we should use
npm run-script run.
Note: `build` and `run` are scripts for npm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment