NPM : how to just run post-install?

node.jsNpmpackage.json

node.js Problem Overview


Just a simple question : in my node.js project, how could I just run the postinstall script, without running install before ?

FYI, this is my package.json :

{
  "name": "gestionclientjs",
  ...,
  "dependencies": {
	...
  },
  "repository": {},
  "devDependencies": {
	...
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "grunt test",
    "postinstall" : "bower install && node ./app/server/dbSeed.js",
    "start": "node app/server/app.js"
  }
}

For now, I run :

npm install

in my project, but I want to run

npm postinstall

when I want (and when I'm sure dependencies are ok).

node.js Solutions


Solution 1 - node.js

You can run individual script entries using npm run SCRIPTNAME:

$ npm run postinstall

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionnoelmView Question on Stackoverflow
Solution 1 - node.jsrobertklepView Answer on Stackoverflow