NodeJS /lib 64/libm.so.6中指定的文件类型:未找到'GLIBC_2.27'版本-将最新的gatsby应用程序部署到Amazon Amplify时出错

vlurs2pr  于 2022-12-12  发布在  Node.js
关注(0)|答案(1)|浏览(453)

我试图部署一个网站,我只是用React放大,但我一直得到这个错误:

node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)

这是来自放大器控制台的完整消息:

2022-11-29T03:46:43.053Z [INFO]: Now using node v18.0.0 (npm v)
2022-11-29T03:46:43.080Z [INFO]: Installing default global packages from /root/.nvm/default-packages...
2022-11-29T03:46:43.080Z [INFO]: npm install -g --quiet yarn@1.22.0
2022-11-29T03:46:43.082Z [WARNING]: node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
                                    node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
2022-11-29T03:46:43.083Z [WARNING]: Failed installing default packages. Please check if your default-packages file or a package in it has problems!
2022-11-29T03:46:43.084Z [INFO]: # Executing command: yarn install
2022-11-29T03:46:43.115Z [WARNING]: node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
                                    node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
2022-11-29T03:46:43.115Z [ERROR]: !!! Build failed
2022-11-29T03:46:43.116Z [ERROR]: !!! Non-Zero Exit Code detected

我已经尝试指定我想要使用的节点版本,因为gatsby需要v18.0.0以上的版本,所以我的package.json看起来如下:

"engines" : { 
    "node" : ">=18.0.0" //
  }

有什么办法吗?
以下是我构建设置:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - nvm install 18.12.1
        - yarn install
    build:
      commands:
        - yarn run build
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
wlzqhblo

wlzqhblo1#

尝试使用GatsbyJS在AWS Amplify上构建新应用程序时遇到相同的错误。我尝试安装缺少的依赖项glibc-devel。它实际上是核心存储库的最新版本,但仍落后于此特定版本节点所需的正确版本。
我将该版本的节点切换到docker映像,它运行得很好(特别是node:18.12)。

相关问题