react-scripts构建冻结在“创建优化的构建”中

时间:2019-11-25 14:03:06

标签: create-react-app react-scripts

我已经升级了我的CRA项目以使用react-scripts 3.2.0 当我运行npm run build时,收到“正在创建优化的生产版本...”消息,但是什么也没发生,它永远卡住了。

环境:

节点:v12.13.1

npm:6.12.1

项目详细信息:

打字稿,scss和scss模块

package.json

    "dependencies": {
        "@types/jest": "^24.0.11",
        "@types/node": "^11.13.4",
        "@types/react": "^16.8.13",
        "@types/react-dom": "16.8.4",
        "classnames": "^2.2.5",
        "mobx": "^3.6.2",
        "mobx-react": "^4.4.3",
        "node-sass": "^4.12.0",
        "react": "^16.8.6",
        "react-scripts": "^3.2.0",
    },
    "devDependencies": {
        "@typescript-eslint/eslint-plugin": "^2.6.1",
        "@typescript-eslint/parser": "^2.6.1",
        "babel-plugin-transform-decorators-legacy": "^1.3.4",
        "enzyme": "^3.7.0",
        "enzyme-adapter-react-16": "^1.6.0",
        "husky": "^3.0.9",
        "lint-staged": "^9.4.2",
        "prettier": "^1.19.1",
        "typescript": "^3.2.4"
    },

tsconfig.json

{
    "compilerOptions": {
        "outDir": "build/dist",
        "module": "esnext",
        "target": "es5",
        "lib": ["es2016", "dom"],
        "sourceMap": true,
        "allowJs": true,
        "jsx": "preserve",
        "moduleResolution": "node",
        "rootDir": "src",
        "forceConsistentCasingInFileNames": true,
        "noImplicitReturns": true,
        "noImplicitThis": false,
        "noImplicitAny": false,
        "strictNullChecks": false,
        "suppressImplicitAnyIndexErrors": true,
        "noUnusedLocals": false,
        "experimentalDecorators": true,
        "skipLibCheck": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strict": true,
        "resolveJsonModule": true,
        "isolatedModules": true,
        "noEmit": true
    },
    "include": ["src"],
    "types": ["react"]
}

1 个答案:

答案 0 :(得分:1)

这很可能是因为RAM不足。生成命令所需的RAM超出您的预期。