{"id":161,"hash":"3c473721e369989c58d8e15f1a3819b75e05824a3945bbbd92ccab56037c0ba6","pattern":"How to fix Next.js Vercel deployment module not found error","full_message":"My next.js app works on my machine and was working when deployed on Vercel but now it fails when building on Vercel with the following error: \n\nI've tried deleting node_modules and running npm install a few times but with no joy. \n\nAny help would be hugely appreciated. Thank you!\n\n  Running \"npm run build\"\n  20:43:24.926\n\n  tdwcks@1.0.0 build /vercel/5ccaedc9\n  20:43:24.926\n\n  next build\n  20:43:24.967\n\n  internal/modules/cjs/loader.js:983\n  20:43:24.967\n\n    throw err;\n  20:43:24.967\n\n    ^\n  20:43:24.967\n\n  Error: Cannot find module '../build/output/log'\n  20:43:24.967\n\n  Require stack:\n  20:43:24.967\n\n  - /vercel/5ccaedc9/node_modules/.bin/next\n  20:43:24.967\n\n      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)\n  20:43:24.967\n\n      at Function.Module._load (internal/modules/cjs/loader.js:862:27)\n  20:43:24.967\n\n      at Module.require (internal/modules/cjs/loader.js:1042:19)\n  20:43:24.967\n\n      at require (internal/modules/cjs/helpers.js:77:18)\n  20:43:24.967\n\n      at Object. (/vercel/5ccaedc9/node_modules/.bin/next:2:46)\n  20:43:24.967\n\n      at Module._compile (internal/modules/cjs/loader.js:1156:30)\n  20:43:24.967\n\n      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)\n  20:43:24.967\n\n      at Module.load (internal/modules/cjs/loader.js:1000:32)\n  20:43:24.967\n\n      at Function.Module._load (internal/modules/cjs/loader.js:899:14)\n  20:43:24.967\n\n      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {\n  20:43:24.967\n\n    code: 'MODULE_NOT_FOUND',\n  20:43:24.967\n\n    requireStack: [ '/vercel/5ccaedc9/node_modules/.bin/next' ]\n  20:43:24.967\n\n  }\n  20:43:24.969\n\n  npm ERR! code ELIFECYCLE\n  20:43:24.969\n\n  npm ERR! errno 1\n  20:43:24.970\n\n  npm ERR! tdwcks@1.0.0 build: next build\n  20:43:24.970\n\n  npm ERR! Exit status 1\n  20:43:24.970\n\n  npm ERR! \n  20:43:24.970\n\n  npm ERR! Failed at the tdwcks@1.0.0 build script.\n  20:43:24.970\n\n  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n  20:43:24.974\n\n  npm ERR! A complete log of this run can be found in:\n  20:43:24.974\n\n  npm ERR!     /vercel/.npm/_logs/2020-06-17T19_43_24_971Z-debug.log\n  20:43:24.979\n\n  Error: Command \"npm run build\" exited with 1\n  20:43:25.342\n\n  [dmesg] follows:\n  20:43:25.342\n\n  [  962.449223] ecs-bridge: port 1(veth2a021300) entered disabled state\n  20:43:25.342\n\n  [  962.453655] device veth2a021300 entered promiscuous mode\n  20:43:25.342\n\n  [  962.457686] ecs-bridge: port 1(veth2a021300) entered blocking state\n  20:43:25.342\n\n  [  962.462004] ecs-bridge: port 1(veth2a021300) entered forwarding state\n  20:43:26.242\n\n  Done with \"package.json\"\n\nHere's my Package.json\n\n{\n  \"name\": \"tdwcks\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"dev\": \"next\",\n    \"build\": \"next build\",\n    \"start\": \"next start\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"cjs\": \"0.0.11\",\n    \"core-util-is\": \"^1.0.2\",\n    \"framer-motion\": \"^1.11.0\",\n    \"gray-matter\": \"^4.0.2\",\n    \"next\": \"^9.4.4\",\n    \"raw-loader\": \"^4.0.1\",\n    \"react\": \"^16.13.1\",\n    \"react-dom\": \"^16.13.1\",\n    \"react-ga\": \"^3.0.0\",\n    \"react-markdown\": \"^4.3.1\",\n    \"react-player\": \"^2.2.0\",\n    \"react-scripts\": \"^3.4.1\"\n  },\n  \"devDependencies\": {\n    \"postcss-preset-env\": \"^6.7.0\",\n    \"tailwindcss\": \"^1.4.6\"\n  }\n}","ecosystem":"npm","package_name":"reactjs","package_version":null,"solution":"This error typically happens if you're accidentally committing node_modules to your project's Git Repostiory.\n\nCould you try to do the following?\n\nEnsure all changes have been committed and you have a clean directory.\nRun rm -rf node_modules (or delete the folder on Windows).\nRun git add -A then git commit -m \"Remove all module files\".\nAdd node_modules to your .gitignore file (and save).\nRun git add -A then git commit -m \"Update ignored files\".\nVerify your directory is completely clean via git status.\nThen, run git push. This deployment should work on Vercel.\nFinally, re-run npm i or yarn depending on your package manager to get your local copy working.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/62378045/how-to-fix-next-js-vercel-deployment-module-not-found-error","votes":60,"created_at":"2026-04-19T04:41:25.076521+00:00","updated_at":"2026-04-19T04:51:06.848522+00:00"}