CircleCI 构建错误 - Firebase CLI 和 Node.js 兼容性

问题描述 投票:0回答:1

Stack Overflow 社区您好,

我希望这条消息对您有好处。我在个人项目的 CircleCI 构建中遇到了问题,特别是与 Firebase CLI 和 Node.js 版本之间的兼容性相关。尽管我确实在 config.yml 文件中设置了配置,但无法更新 node.js 版本。我搜索了与此问题相关的提示和信息,但找不到解决方案。

以下是错误信息

Firebase CLI v13.0.0 is incompatible with Node.js v16.16.0
Please upgrade Node.js to version >=18.0.0 || >=20.0.0
Exited with code exit status 1

Error image I got at CIrcleCI

我尝试通过以下方式更新 config.yml 文件来解决此问题,但仍然遇到相同的错误。


# ... (other configuration)

- run:
    name: "Update Node.js"
    command: |
      curl -sSL "https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v18.16.0-linux-x64/bin/node
      node --version
      npm --version

- run:
    name: output updated node version
    command: node -v

- run:
    name: Update PATH
    command: |
      echo 'export PATH=/usr/local/bin:$PATH' >> $BASH_ENV
      source $BASH_ENV
      which node
      node --version

- run:
    name: Install Firebase CLI
    command: |
      curl -sL https://firebase.tools/bin/linux/latest -o firebase-cli
      chmod +x firebase-cli
      ./firebase-cli
      firebase --version
# ... (other configuration)

不幸的是,这些改变并没有解决问题。我正在向社区寻求有关如何在 CircleCI 构建中正确解决 Firebase CLI 和 Node.js 兼容性问题的指导或示例。

您可以提供的任何帮助或提示将不胜感激。预先感谢您的时间和专业知识。

android node.js github circleci firebase-tools
1个回答
0
投票

自动安装程序出现问题。 https://github.com/firebase/firebase-tools/issues/6586#issuecomment-1845675868

来自贡献者的引用:

firebase.tools 的构建与 Node JS 捆绑在一起(这就是为什么它们“开箱即用”)。在发布 13.0.0 时,我们最初想要打包 Node 20 - 然而,我们用来执行此操作的工具之一不支持 Node 20。在尝试修复此问题时,似乎我不小心使用 Node 16 进行了构建。

© www.soinside.com 2019 - 2024. All rights reserved.