繁体   English   中英

什么是 npm ERR! 代码生命周期?

[英]What is npm ERR! code ELIFECYCLE?

我在两个不同的 npm 包上遇到了同样的错误,但似乎无法弄清楚。 我已经检查了这个答案,我没有运行任何其他服务器。 我还尝试删除我的 module_packages 文件夹,清理npm cache clean然后使用npm i重新安装,正如许多线程所建议的那样,但我仍然遇到相同的错误。

  • 视窗 10 64 位
  • 节点 8.9.4
  • npm 5.6.0

C:\\Users\\hunter\\Documents\\vid>npm install npm install github:storj/node-libstorj --save

> storj@5.1.0 preinstall C:\Users\hunter\Documents\vid\node_modules\storj
> node ./download.js

Unable to download libstorj for platform: win32 and arch: x64
npm WARN vid@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! storj@5.1.0 preinstall: `node ./download.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the storj@5.1.0 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hunter\AppData\Roaming\npm-cache\_logs\2018-03-25T15_44_06_578Z-debug.log

关于可能导致错误的任何想法都会有所帮助。

我有好消息和坏消息要告诉你。 首先是好消息:您的计算机一切正常。

坏消息:您要安装的模块与 Windows 操作系统不兼容。 查看错误消息的第一行:

Unable to download libstorj for platform: win32 and arch: x64

这个问题在 GitHub 上已经有一个 open issue,参见: https : //github.com/Storj/node-libstorj/issues/43

如本期所述,存在多个问题:

  • 下载/解压不起作用
  • 不编译,因为正在使用一些 linux-only 函数(访问函数)
  • 未链接(似乎荨麻和其他一些链接失败)

所以你有两个选择:等到这个问题得到解决 - 或者 - 切换你的操作系统;-)

我在尝试通过 package.json 中的脚本条目运行“usemin”和“imagemin”节点模块时遇到“code ELIFECYCLE”错误。 这些脚本条目在 Coursera“全栈开发人员”课程中给出: "imagemin": "imagemin img/* -o dist/img/ && "usemin": "usemin index.html -d dist -o dist/index.html ”,

第一行应该是: "imagemin": "imagemin --out-dir=dist/img/ img/**/*.{png,jpg,git}"

usemin 给出“code ELIFECYLE”错误的问题最终归结为我安装的是 API 版本(“npm install usemin”)而不是 cli 版本(“npm install usemin-cli)。

希望以上内容可以帮助其他一些 nubbie 避免现在看起来很明显的错误!

暂无
暂无

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

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