Nextjs 'next build' runs in local but fails when Deployment to Vercel without showing any error except "Error: Command "npm run build" exited with 1"

Viewed 418

On Vercel it only shows Error: Command 'npm run build' exited with 1 without showing any other errors, I have tried everything from refactoring to removing unused file and throwing unused dependencies to devDependencies but there is still no error like module not found or anything the build just fails But when locally build, npm run dev and npm run build works perfectly fine

The build Log of vercel is

Installing dependencies...
15:18:55.150
15:18:55.151
> node-sass@4.14.1 install /vercel/path0/node_modules/node-sass
15:18:55.151
> node scripts/install.js
15:18:55.151
15:18:55.626
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-83_binding.node
15:18:55.714
Download complete
15:18:55.719
Binary saved to /vercel/path0/node_modules/node-sass/vendor/linux-x64-83/binding.node
15:18:55.789
Caching binary to /vercel/.npm/node-sass/4.14.1/linux-x64-83_binding.node
15:18:55.889
15:18:55.890
> core-js-pure@3.16.3 postinstall /vercel/path0/node_modules/core-js-pure
15:18:55.890
> node -e "try{require('./postinstall')}catch(e){}"
15:18:55.890
15:18:55.973
[96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
15:18:55.974
15:18:55.974
[96mThe project needs your help! Please consider supporting of core-js:[0m
15:18:55.974
[96m>[94m https://opencollective.com/core-js [0m
15:18:55.974
[96m>[94m https://patreon.com/zloirock [0m
15:18:55.974
[96m>[94m https://paypal.me/zloirock [0m
15:18:55.974
[96m>[94m bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz [0m
15:18:55.974
15:18:55.974
[96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
15:18:55.975
15:18:56.213
15:18:56.213
> node-sass@4.14.1 postinstall /vercel/path0/node_modules/node-sass
15:18:56.213
> node scripts/build.js
15:18:56.213
15:18:56.472
Binary found at /vercel/path0/node_modules/node-sass/vendor/linux-x64-83/binding.node
15:18:56.473
Testing binary
15:18:56.715
Binary is fine
15:18:57.319
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
15:18:57.319
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
15:18:57.320
15:18:57.326
added 991 packages from 465 contributors in 22.931s
15:18:57.795
15:18:57.795
94 packages are looking for funding
15:18:57.796
  run `npm fund` for details
15:18:57.796
15:18:57.825
Detected Next.js version: 11.1.0
15:18:57.831
Running "npm run build"
15:18:58.106
15:18:58.107
> site-redesign-react@0.1.0 build /vercel/path0
15:18:58.107
> next build
15:18:58.107
15:18:59.061
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
15:18:59.224
Attention: Next.js now collects completely anonymous telemetry regarding usage.
15:18:59.224
This information is used to shape Next.js' roadmap and prioritize features.
15:18:59.224
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
15:18:59.224
https://nextjs.org/telemetry
15:18:59.224
15:18:59.277
info  - Checking validity of types...
15:19:02.122
jsxBracketSameLine is deprecated.
15:19:13.365
Error: Command "npm run build" exited with 1```
0 Answers
Related