列出带有后安装挂钩的NPM软件包

发布于 2025-02-05 03:11:04 字数 96 浏览 2 评论 0原文

为了在隔离网络中的CI/CD上运行构建,我想知道项目中的poststall脚本在做什么,因此我可以相应地配置网络。

有没有更好的方法来查看哪些软件包执行后安装脚本?

For running my build on a CI/CD that's inside an isolated network I would like to know what the postinstall scripts in my project are doing, so I can configure the network accordingly.

Is there a better way than reverse engineering to see which packages execute postinstall scripts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

没有伤那来痛 2025-02-12 03:11:04

回答原始问题,您可以运行一些这样的命令,以获取具有后安装脚本的所有dep的列表:

npm query ":attr(scripts, [postinstall])" | jq 'map(.name)'

Answering the original question, you can run some command like this to get a list of all deps that have postinstall scripts:

npm query ":attr(scripts, [postinstall])" | jq 'map(.name)'
玻璃人 2025-02-12 03:11:04

@lavamoat/washer-scripts

只需添加

"lavamoat": {
  "allowScripts": {
      "@some/script-with-postinstall": true
  }
}

package.json即可运行允许脚本的后安装。

npx allow-scripts auto

可用于使用后插头挂钩检测脚本

there is @lavamoat/allow-scripts.

simply add

"lavamoat": {
  "allowScripts": {
      "@some/script-with-postinstall": true
  }
}

to the package.json to run the postinstall of the allowed scripts.

npx allow-scripts auto

can be used to detect scripts with a postinstall hook

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文