npm:禁用包的安装后脚本 [英] npm: disable postinstall script for package
本文介绍了npm:禁用包的安装后脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何 npm 选项可以在安装软件包时禁用 postinstall 脚本?或者重写 package.json 中的任何字段?
Is it any npm option exist to disable postinstall script while installing package? Or for rewriting any field from package.json?
推荐答案
不可能仅禁用 postinstall
脚本.但是,您可以使用以下方法禁用所有脚本:
It's not possible to disable only postinstall
scripts. However, you can disable all scripts using:
$ npm install --ignore-scripts
正如 delbertooo 在评论中提到的,这也会禁用依赖项的脚本.
As delbertooo mentionned in the comments, this also disables the scripts of the dependencies.
这篇关于npm:禁用包的安装后脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文