首页 > 解决方案 > npm 错误!react-amplify-project-three@0.1.0 build: `react-scripts --max_old_space_size=2048 build`

问题描述

错误:

npm ERR! code ELIFECYCLE

npm ERR! errno 1
npm ERR! react-amplify-project-three@0.1.0 build: `react-scripts --max_old_space_size=2048 build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-amplify-project-three@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-30T05_23_44_594Z-debug.log

在 Bitbucket Pipeline 中运行此步骤:

  - step:
      name: Dev Docker Build
      deployment: dev-docker-build
      trigger: manual
      size: 2x
      script:
        - npm install
        - npm run build

使用的配置:

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts --max_old_space_size=2048 build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"

解决方案是什么?

标签: node.jsnpmbitbucketbitbucket-pipelines

解决方案


我对此有答案。在你的 npm 命令中添加这一行“CI=false”

  - npm install
  - CI=false npm run build

推荐阅读