Reactjs macOS Big Sur更新后React内置Docker容器失败
更新到macOS Big Sur后,我无法在Docker容器中构建ReactReactjs macOS Big Sur更新后React内置Docker容器失败,reactjs,docker,build,containers,macos-big-sur,Reactjs,Docker,Build,Containers,Macos Big Sur,更新到macOS Big Sur后,我无法在Docker容器中构建React => ERROR [base_build 9/9] RUN npm run build 94.4s ------
=> ERROR [base_build 9/9] RUN npm run build 94.4s
------
> [base_build 9/9] RUN npm run build:
#23 1.110
#23 1.110 > mp-app@0.1.0 build /app
#23 1.110 > react-scripts build
#23 1.110
#23 4.913 Creating an optimized production build...
#23 93.67 The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
#23 93.98 npm ERR! code ELIFECYCLE
#23 93.98 npm ERR! errno 1
#23 94.01 npm ERR! mp-app@0.1.0 build: `react-scripts build`
#23 94.01 npm ERR! Exit status 1
#23 94.01 npm ERR!
#23 94.01 npm ERR! Failed at the mp-app@0.1.0 build script.
#23 94.01 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#23 94.18
#23 94.18 npm ERR! A complete log of this run can be found in:
#23 94.19 npm ERR! /root/.npm/_logs/2021-05-12T07_02_11_162Z-debug.log
------
executor failed running [/bin/sh -c npm run build]: exit code: 1
解决问题的方法是将项目从
Spotlight
索引工具中排除。看起来这一个使用了很多资源,这使得构建失败。转到系统首选项
,然后搜索聚光灯
。然后转到隐私
选项卡并添加包含项目的目录。我不必重新启动笔记本电脑,但这可能也是必要的。它降低了笔记本电脑的温度,并略微提高了速度