簡體   English   中英

NPM 失敗,代碼為:npm ERR! 代碼生命周期

[英]NPM fails with the code: npm ERR! code ELIFECYCLE

我對節點和 javascript 相當陌生。 我正在嘗試在我的本地主機https://github.com/bitpay/wallet上運行它

最初我使用的是 node.js v14,但出現錯誤。 我做了一些研究,發現我應該降級到 node.js v11。

這樣做之后,我在嘗試運行 npm 安裝后出現錯誤。

'rm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! copay@12.1.1 env:dev: `rm -f src/environments/index.ts && cp src/environments/dev.ts src/environments/index.ts

npm ERR!
npm ERR! # Environment set to: dev
npm ERR!
npm ERR! `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the copay@12.1.1 env:dev 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\Jacob\AppData\Roaming\npm-cache\_logs\2021-03-01T19_15_48_533Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! copay@12.1.1 postinstall: `npm run env:dev && npm run prompt && npm run patch:bwc && npm run patch:walletconnec
t`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the copay@12.1.1 postinstall 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\Jacob\AppData\Roaming\npm-cache\_logs\2021-03-01T19_15_48_594Z-debug.log

我不確定該怎么做才能解決這個問題。 我已閱讀其他帖子並嘗試按照他們的建議進行操作。 我刪除了 node_modules 文件並清除了緩存,但我仍然遇到同樣的錯誤。 我注意到它說'rm'不被識別為內部或外部命令。 我試圖將其更改為 del 而不是 rm 但這似乎也無濟於事。 關於如何讓它在我的本地主機上工作的任何建議?

這是您共享的日志中的第一行,指示錯誤是什么

'rm' is not recognized as an internal or external command,

it happens since (as you mentioned) you are running windows and i assume you are running npm under cmd or powershell, which does not have rm command natively.

我建議您為 linux 切換到 windows 子系統,它應該具有像rm這樣的系統命令,看看它是否能解決您的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM