简体   繁体   English

npm脚本运行用于预安装,但不用于preupdate

[英]npm script running for preinstall, but not for preupdate

I have a script referenced in packages.json for a node app. 我在packages.json中为节点应用程序引用了一个脚本。

The script is run fine when I do 我做的时候脚本运行正常

npm install

but not for 但不是

npm update

The excerpt from packages.json is packages.json的摘录是

"scripts": {
    "start": "node app.js",
    "preinstall": "node scripts/install.js",
    "preupdate": "node scripts/install.js"
}

The whole file is at https://github.com/Pike/outreach/blob/master/package.json . 整个文件位于https://github.com/Pike/outreach/blob/master/package.json

As I understand it they've disabled the scripts for npm update (preupdate/postupdate) -- something about best practice... 根据我的理解,他们已经禁用了npm update(preupdate / postupdate)的脚本 - 关于最佳实践......

It's a complete pain in the ass -- they want you to use node-gyp and .gyp files for building node modules -- it has a dependency on python! 这是一个完全痛苦的屁股 - 他们希望你使用node-gyp和.gyp文件来构建节点模块 - 它依赖于python! No thanks! 不用了,谢谢!

I'm still banging my head on the keyboard over this -- since we cant install python on our production servers. 由于我们无法在生产服务器上安装python,因此我还在敲打键盘。

Update Python is available on most Linux Distros, not too much of a big deal 大多数Linux发行版都提供了更新 Python,这不是什么大不了的事

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM