簡體   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