Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

When I try to deploy React app, it fails during ‘Build image phase’:

 #14 ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

------

> [build 5/6] RUN npm run build:

6.254 - /app/node_modules/@babel/core/lib/config/files/index.js

6.254 - /app/node_modules/@babel/core/lib/index.js

6.254 - /app/node_modules/@rollup/plugin-babel/dist/index.js

6.254 - /app/node_modules/workbox-build/build/lib/bundle.js

6.254 - /app/node_modules/workbox-webpack-plugin/build/generate-sw.js

6.254 - /app/node_modules/workbox-webpack-plugin/build/index.js

6.254 - /app/node_modules/react-scripts/config/webpack.config.js

6.254 - /app/node_modules/react-scripts/scripts/build.js (While processing: "/app/node_modules/babel-preset-react-app/prod.js")

6.254

6.254

------

Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

unsuccessful command 'flyctl deploy --build-only --push -a recruiter-info-ui-qikfxg --image-label deployment-ade5e31b3ff12d176cdc019b7e32372a --config fly.toml' 

How to troubleshoot the issue?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.