代码之家  ›  专栏  ›  技术社区  ›  Shilp Thapak

下一个js部署在AWS Amplify上失败。获取错误:构建失败

  •  0
  • Shilp Thapak  · 技术社区  · 1 年前

    我正试图在AWS Amplify上部署我的下一个js应用程序。它失败了,给出了错误“构建失败”。 错误:命令失败,退出代码为1

    以下是日志:

                                     # Starting phase: preBuild
                                     # Executing command: npm ci
    2024-02-18T20:54:42.946Z [WARNING]: npm
    2024-02-18T20:54:42.946Z [WARNING]: WARN EBADENGINE Unsupported engine {
                                        npm WARN EBADENGINE   package: '[email protected]',
                                        npm WARN EBADENGINE   required: { node: '>=18.17.0' },
                                        npm WARN EBADENGINE   current: { node: 'v16.19.0', npm: '8.19.3' }
                                        npm WARN EBADENGINE }
    2024-02-18T20:54:47.954Z [WARNING]: npm
    2024-02-18T20:54:47.962Z [WARNING]: WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
    2024-02-18T20:54:48.075Z [WARNING]: npm WARN
    2024-02-18T20:54:48.075Z [WARNING]: deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
    2024-02-18T20:54:48.185Z [WARNING]: npm WARN deprecated
    2024-02-18T20:54:48.186Z [WARNING]: [email protected]: https://github.com/lydell/resolve-url#deprecated
    2024-02-18T20:54:48.255Z [WARNING]: npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
    2024-02-18T20:54:48.400Z [WARNING]: npm WARN
    2024-02-18T20:54:48.401Z [WARNING]: deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
    2024-02-18T20:54:54.372Z [INFO]: added 545 packages, and audited 546 packages in 14s
    2024-02-18T20:54:54.379Z [INFO]: 124 packages are looking for funding
                                     run `npm fund` for details
    2024-02-18T20:54:54.380Z [INFO]: 4 high severity vulnerabilities
                                     To address all issues (including breaking changes), run:
                                     npm audit fix --force
                                     Run `npm audit` for details.
    2024-02-18T20:54:54.402Z [INFO]: # Completed phase: preBuild
                                     # Starting phase: build
                                     # Executing command: npm run build
    2024-02-18T20:54:54.738Z [INFO]: > [email protected] build
                                     > next build
    2024-02-18T20:54:54.795Z [WARNING]: You are using Node.js 16.19.0. For Next.js, Node.js version >= v18.17.0 is required.
    2024-02-18T20:54:54.807Z [ERROR]: !!! Build failed
    2024-02-18T20:54:54.807Z [INFO]: Please read more about Amplify Hosting's support for SSR frameworks to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/amplify-ssr-framework-support.html. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
    2024-02-18T20:54:54.809Z [ERROR]: !!! Error: Command failed with exit code 1
    2024-02-18T20:54:54.809Z [INFO]: # Starting environment caching...
    2024-02-18T20:54:54.809Z [INFO]: # Environment caching completed
    Terminating logging...
    
    1 回复  |  直到 1 年前
        1
  •  0
  •   Shilp Thapak    1 年前

    问题在于AWS使用的默认映像。可以通过使用 amplify:al2023 构建设置中的图像。

    enter image description here