1

I'm trying to deploy a nextJs app but when I run npm run build I see some of the errors listed below:

Build error occurred Error:

Build failed because of webpack errors at /Users/hassan/Upwork/ROCProjectNext.js/ROCNext/node_modules/next/dist/build/index.js:15:918 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async /Users/hassan/Upwork/ROC Project Next.js/ROC- Next/node_modules/next/dist/build/tracer.js:1:525

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] build: next build

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] 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!
/Users/hassan/.npm/_logs/2021-04-07T06_52_28_325Z-debug.log

any suggestions?

juliomalves
51k23 gold badges180 silver badges170 bronze badges
asked Apr 7, 2021 at 7:04
1
  • Maybe problem in your package.json file, check this one. Commented Apr 7, 2021 at 16:40

1 Answer 1

2

Kindly check your nextjs version in package.json file it is upgraded to latest version. Downgrade the version of nextjs it will help you to avoid this error.

U13-Forward
71.8k15 gold badges100 silver badges125 bronze badges
answered Nov 10, 2021 at 7:57
Sign up to request clarification or add additional context in comments.

1 Comment

I am getting a similar error. npm run build works but next build returns "Failed to compile. Module not found: Error: Can't resolve './C:/ProgramData/nvm/v16.4.2/node_modules/next/dist/client/next.js' in 'D:\App\nextjs-blog' > Build failed because of webpack errors" I ensured net is the same version globally (in programeData) and locally for my project (in D:/App)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.