I'm trying to run npm run build to check if my Next.js project is ready for deployment. However, when I execute the command in VS Code, it gets stuck and does not complete. The terminal only shows: [email protected] build
next build
It has been stuck like this for several minutes without any progress. I previously attempted to deploy my project on Vercel, but I encountered 27 errors. After fixing all the errors, I wanted to verify that the build works locally before pushing the changes again. However, it seems like the build process is now stuck.
Upon checking Task Manager, I noticed that node.exe is using a significant amount of memory:
node.exe private memory usage: ~445,276 KB (~445MB) Working set memory: ~264,148 KB It appears that the npm run build process is consuming a lot of memory and getting stuck.
I did not delete .next or node_modules folders yet, because I am unsure if that would be a good idea. I fixed all previously reported build errors (27 errors) before running npm run build, but now it just hangs. I want to debug this issue properly before I try deploying again on Vercel. Would deleting .next or node_modules cause any unintended issues, and should I try it?