NPM:如何 运行 post-install?

NPM : how to just run post-install?

只是一个简单的问题:在我的 node.js 项目中,我怎么能只 运行 安装后脚本,而不先 运行 安装?

仅供参考,这是我的 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"
  }
}

现在,我 运行 :

npm install

在我的项目中,但我想 运行

npm postinstall

当我想要的时候(当我确定依赖关系没问题的时候)。

您可以 运行 使用 npm run SCRIPTNAME 的单个脚本条目:

$ npm run postinstall