Ive seen a few posts about this but ive been unable to find a solution as of yet. Im trying to create a react.js app with an Amplify backend with graphQL, for whatever reason when i try run my Build on AWS Amplify i get the following error.
2022-05-31T03:56:26.492Z [INFO]: Creating an optimized production build...
2022-05-31T03:56:27.198Z [INFO]: Failed to compile.
2022-05-31T03:56:27.199Z [INFO]: Module not found: Error: Can't resolve './aws-exports' in '/codebuild/output/src520478948/src/my-vet-dental/src'
2022-05-31T03:56:27.210Z [WARNING]: npm
2022-05-31T03:56:27.210Z [WARNING]: ERR! code ELIFECYCLE
npm ERR! errno 1
2022-05-31T03:56:27.212Z [WARNING]: npm
2022-05-31T03:56:27.213Z [WARNING]: ERR! my-vet-dental#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-vet-dental#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-05-31T03:56:27.220Z [WARNING]:
2022-05-31T03:56:27.220Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-05-31T03_56_27_213Z-debug.log
2022-05-31T03:56:27.220Z [HELP]: Outputting the npm debug log
[object Promise]
2022-05-31T03:56:27.223Z [ERROR]: !!! Build failed
2022-05-31T03:56:27.223Z [ERROR]: !!! Non-Zero Exit Code detected
2022-05-31T03:56:27.223Z [INFO]: # Starting environment caching...
2022-05-31T03:56:27.224Z [INFO]: # Environment caching completed
How do i fix this issue?
Related
I have a custom-built CKEditor5 in a react application. I downloaded the custom-built CKEditor5 and included it in the source code like the image below.
Package layout
It is working and building locally fine with no problems. However, when I push to amplify, it fails to build
2022-09-23T19:22:53.142Z [INFO]: Creating an optimized production build...
2022-09-23T19:23:16.863Z [INFO]: Failed to compile.
2022-09-23T19:23:16.867Z [INFO]: Module not found: Error: Can't resolve 'ckeditor5-custom-build/build/ckeditor' in '/codebuild/output/src100157020/src/content-writing/src/Components'
2022-09-23T19:23:16.903Z [WARNING]: npm
2022-09-23T19:23:16.904Z [WARNING]: ERR! code ELIFECYCLE
npm ERR! errno 1
2022-09-23T19:23:16.906Z [WARNING]: npm
2022-09-23T19:23:16.906Z [WARNING]: ERR! content-writing#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the content-writing#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Any idea what is the issue or how to fix it?
I'm trying to deploy a React App in AWS Amplify but during the Build process, AWS Amplify throws below error:
Module not found: Error: Can't resolve 'bootstrap/dist/css/bootstrap.css' in '/codebuild/output/src489574561/src/user-management-frontend/src'
I'm wondering how to solve this error by changing something in code or need to configure AWS Amplify.
Full log trace is here:
# Starting phase: preBuild
# Executing command: npm ci
2022-09-07T06:11:29.303Z [INFO]: > core-js#3.25.0 postinstall /codebuild/output/src489574561/src/user-management-frontend/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
2022-09-07T06:11:29.350Z [INFO]: [96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
[96mThe project needs your help! Please consider supporting of core-js:[0m
[96m>[94m https://opencollective.com/core-js [0m
[96m>[94m https://patreon.com/zloirock [0m
[96m>[94m bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz [0m
[96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
2022-09-07T06:11:29.558Z [INFO]: > core-js-pure#3.25.0 postinstall /codebuild/output/src489574561/src/user-management-frontend/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
2022-09-07T06:11:29.895Z [INFO]: added 1501 packages in 21.092s
2022-09-07T06:11:29.908Z [INFO]: # Completed phase: preBuild
# Starting phase: build
2022-09-07T06:11:29.908Z [INFO]: # Executing command: npm run build
2022-09-07T06:11:30.074Z [INFO]: > user-management-frontend#0.1.0 build /codebuild/output/src489574561/src/user-management-frontend
> react-scripts build
2022-09-07T06:11:31.296Z [INFO]: Creating an optimized production build...
2022-09-07T06:11:31.983Z [INFO]: Failed to compile.
2022-09-07T06:11:31.983Z [INFO]: Module not found: Error: Can't resolve 'bootstrap/dist/css/bootstrap.css' in '/codebuild/output/src489574561/src/user-management-frontend/src'
2022-09-07T06:11:31.994Z [WARNING]: npm
2022-09-07T06:11:31.994Z [WARNING]: ERR! code ELIFECYCLE
npm ERR! errno 1
2022-09-07T06:11:31.996Z [WARNING]: npm
2022-09-07T06:11:31.996Z [WARNING]: ERR! user-management-frontend#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the user-management-frontend#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-09-07T06:11:32.000Z [WARNING]:
2022-09-07T06:11:32.000Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-09-07T06_11_31_997Z-debug.log
2022-09-07T06:11:32.000Z [HELP]: Outputting the npm debug log
[object Promise]
2022-09-07T06:11:32.003Z [ERROR]: !!! Build failed
2022-09-07T06:11:32.003Z [ERROR]: !!! Non-Zero Exit Code detected
2022-09-07T06:11:32.003Z [INFO]: # Starting environment caching...
2022-09-07T06:11:32.004Z [INFO]: # Environment caching completed
Terminating logging...
Try installing bootstrap, that's how I solved it.
npm install bootstrap --save
Here is an error (my project works correctly on dev, but when I try to build it, it throws me this error)
> node-react-sample#0.1.0 build /home/acquaint/WORK_DIRECTORY/altr
> node scripts/build.js
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/pdfjs-dist/build/pdf.js:341
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-react-sample#0.1.0 build: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-react-sample#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Build Failed with this error (check screenshot)
After adding the home, predeploy and deploy values to package.JSON and running npm run deploy, the build folder was created successfully but the build was unable to be published.
I got this error
cloning into 'node_modules\gh-pages\.cache\github.com.okafohenry!birthday-list-keeper-react-app-.git'...
fatal: unable to access https://github.com.okafohenry/birthday-list-keeper-react-app-.git/': Could not resolve host: github.com.okafohenry
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! birthdaylistkeeper#1.0.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the birthdaylistkeeper#1.0.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have been on this for a while now, how do I fix it?
The url seems to be wrong.
It should be https://github.com/okafohenry/birthday-list-keeper-react-app-.git/
I started a project using 'create-react-app' command and when I do npm run command the command is successfully run but when I use npm build command it fails with the following error everytime.
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run build --scripts-prepend-node-path=auto
> finteen-web#0.1.0 build /home/jayg/Documents/MyCode/Code/Web/finteen-web
> react-scripts build
Creating an optimized production build...
Failed to compile.
static/js/main.626dbb4b.js from UglifyJs
SyntaxError: Unexpected token: name (length) [/home/jayg/~/punycode/punycode.js:55,0]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! finteen-web#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the finteen-web#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! /home/jayg/.npm/_logs/2019-12-13T17_52_13_422Z-debug.log
Process finished with exit code 1
With create-react-app version:0.9.5
Update your create-react-app version following the CHANGELOG.md of create react app