【发布时间】:2015-09-09 02:40:07
【问题描述】:
只是一个简单的问题:在我的 node.js 项目中,我怎么能只运行 postinstall 脚本,而不运行 install ?
仅供参考,这是我的 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
当我想要时(并且当我确定依赖项没问题时)。
【问题讨论】:
-
postinstall 仅在安装后运行:docs.npmjs.com/misc/scripts
-
如果 npm-install 甚至记录了 postinstall(也许更多?)脚本正在运行,那就太好了...
标签: node.js npm package.json