我剛剛用這個函式更新了 firebase 函式npm i firebase-functions@latest,并更新了npm install -g firebase-tools. 突然間,我無法在firebase deploy --only functions. 我得到了所有這些錯誤:
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.
有誰知道發生了什么?我在

uj5u.com熱心網友回復:
您遇到的問題是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.0or a hypothetical5.9.3-beta這樣的東西不會。
當您運行npm i firebase-functions@latest時,它會抓取開發人員標記為“最新”的版本,即4.0.0-rc-0不滿足上述約束的版本。
我建議顯式安裝穩定版本 ( npm install [email protected]),或者 - 如果您有權訪問firebase-functions-test- 修改該軟體包package.json以指定"firebase-functions": ">=2.0.0 || 4.0.0-rc.0".
查看npm semver 計算器以查看哪些說明符與哪些版本匹配。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/514531.html
標籤:Google Cloud Collective 节点.js火力基地npm谷歌云功能
上一篇:HTML
