NPM:如何运行后安装?

只是一个简单的问题:在我的node.js项目中,我怎么才能运行postinstall脚本,而无需运行安装之前?

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