NPM:如何只运行安装后? [英] NPM : how to just run post-install?
本文介绍了NPM:如何只运行安装后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
只是一个简单的问题:在我的 node.js 项目中,我怎么能只运行 postinstall 脚本,而不运行 install 之前?
Just a simple question : in my node.js project, how could I just run the postinstall script, without running install before ?
仅供参考,这是我的 package.json :
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"
}
}
现在,我运行:
npm install
在我的项目中,但我想运行
in my project, but I want to run
npm postinstall
当我想要时(以及当我确定依赖项没问题时).
when I want (and when I'm sure dependencies are ok).
推荐答案
您可以使用 npm 运行单个脚本条目运行脚本名称
:
You can run individual script entries using npm run SCRIPTNAME
:
$ npm run postinstall
这篇关于NPM:如何只运行安装后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文