Weg*_*ege 6 node.js npm firebase google-cloud-functions
我刚刚用这个函数更新了 firebase 函数npm i firebase-functions@latest
,并更新了npm install -g firebase-tools
。突然之间,我无法在 部署我的所有功能firebase deploy --only functions
。我遇到了所有这些错误:
Run Code Online (Sandbox Code Playgroud)Build failed: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: firebase-functions-test@0.2.3 npm ERR! Found: firebase-functions@4.0.0-rc.0 npm ERR! node_modules/firebase-functions npm ERR! firebase-functions@"^4.0.0-rc.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer firebase-functions@">=2.0.0" from firebase-functions-test@0.2.3 npm ERR! node_modules/firebase-functions-test npm ERR! dev firebase-functions-test@"^0.2.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: firebase-functions@3.24.1 npm ERR! node_modules/firebase-functions npm ERR! peer firebase-functions@">=2.0.0" from firebase-functions-test@0.2.3 npm ERR! node_modules/firebase-functions-test npm ERR! dev firebase-functions-test@"^0.2.0" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /www-data-home/.npm/eresolve-report.txt for a full report.
有人知道发生了什么事吗?我在stackoverflow上尝试过这个功能,但一点运气都没有。npm install --legacy-peer-deps
请帮我!我这两天都是这样!
小智 2
您遇到的问题是firebase-functions-test
指定它需要 version 的 firebase-functions >=2.0.0
。npm 将此解释为“大于或等于 2.0.0 的稳定版本”。这意味着诸如3.24.1
、3.0.0
、 之类的版本2.3.1
都有效,但诸如4.0.0-rc.0
或 之类的假设5.9.3-beta
则无效。
当您运行 时npm i firebase-functions@latest
,它会获取开发人员标记为“最新”的版本,即4.0.0-rc-0
,它不满足上述约束。
我建议显式安装稳定版本 ( npm install firebase-functions@3.24.1
),或者 - 如果您有权访问firebase-functions-test
- 修改该包package.json
以指定"firebase-functions": ">=2.0.0 || 4.0.0-rc.0"
.
查看npm semver 计算器以查看哪些说明符与哪些版本匹配。
归档时间: |
|
查看次数: |
2328 次 |
最近记录: |