-1
每当我运行npm install时,它都会运行npm run postinstall。我如何添加一个自定义的安装后脚本?这样在运行npm之后安装它运行npm run postinstall2?如何添加自定义的NPM安装后脚本?
每当我运行npm install时,它都会运行npm run postinstall。我如何添加一个自定义的安装后脚本?这样在运行npm之后安装它运行npm run postinstall2?如何添加自定义的NPM安装后脚本?
你用&&
链接叫他们从postinstall
多个脚本:
{
"scripts": {
"script1": "",
"script2": "",
"postinstall": "script1 && script2"
}
}
这应该在Windows和Unix(Linux的,MacOS的)终端都正常工作。
不,我的意思是我们如何让npm install完成后调用脚本以外的脚本。 – Jasmine
@Jasmine有什么意义?只要将其他脚本中的任何内容放到''postinstall''中;或者如果你真的关心了,那么''postinstall':“npm run postinstall2”'但是没有意义。 –