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 install 后收到错误消息。

'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\_logs21-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\_logs21-03-01T19_15_48_594Z-debug.log

我不确定要如何解决这个问题。我读过其他帖子并尝试按照他们的建议去做。我删除了 node_modules 文件并清除了缓存,但我仍然遇到同样的错误。我注意到它说 'rm' 不被识别为内部或外部命令。我试图将其更改为 del 而不是 rm 但这似乎也无济于事。关于如何让它在我的本地主机上工作有什么建议吗?

这是您共享的日志中的第一行,指出错误是什么

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

发生这种情况是因为(正如你提到的)你是 运行 windows 我假设你是 运行 在 cmd 或 powershell 下的 npm,它没有 rm本机命令。

我建议你切换到 windows subsystem for linux,它应该有像 rm 这样的系统命令,看看它是否能解决你的问题。