작성
·
494
0
docker build .
npm run build .
명령어 실행 시
> [builder 7/7] RUN npm run build:
#13 0.734
#13 0.734 > docker-react-app@0.1.0 build
#13 0.734 > react-scripts build
#13 0.734
#13 1.721 /usr/src/app/node_modules/react-scripts/config/webpack.config.js:664
#13 1.721 new MiniCssExtractPlugin({
#13 1.721 ^
#13 1.721
#13 1.721 TypeError: MiniCssExtractPlugin is not a constructor
#13 1.721 at module.exports (/usr/src/app/node_modules/react-scripts/config/webpack.config.js:664:9)
#13 1.721 at Object.<anonymous> (/usr/src/app/node_modules/react-scripts/scripts/build.js:58:16)
#13 1.721 at Module._compile (node:internal/modules/cjs/loader:1097:14)
#13 1.721 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
#13 1.721 at Module.load (node:internal/modules/cjs/loader:975:32)
#13 1.721 at Function.Module._load (node:internal/modules/cjs/loader:822:12)
#13 1.721 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
#13 1.721 at node:internal/main/run_main_module:17:47
#13 1.721
#13 1.721 Node.js v17.3.1
와 같은 오류 나시는분들
아래 명령어로 해결하시면 됩니다.
노드 개발자가 아니라 정확한 원인은 잘 모르겠으나 버전 문제로 보입니다!
npm i -D --save-exact mini-css-extract-plugin@2.4.5