Codex hanging on npm run build
Resolved 💬 6 comments Opened Feb 24, 2026 by TrentPierce Closed Feb 25, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
I am on Windows using v0.104.0 and it keeps getting hung trying to run a build of a website. This worked previously without issue. I reported through /feedback in the app. thread ID 019c8ff9-bdf6-7e70-81f5-a5388ba17f7f
I can open a new terminal window and run npm run build and it completes without issue, so I am not sure what is causing Codex to hang on this.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
You mentioned that it worked previously without issue. That implies it's either a regression in Codex or a change in your system configuration. I suspect it's the latter, but let's rule out the former. Please downgrade to an earlier version of the CLI that was working for you and see if you can repro the problem. If you can, try to figure out the exact version where the problem started to occur.
If downgrading the CLI doesn't fix your problem, then this is related to some change in your system configuration — likely a shell configuration issue.
You mentioned that you're on Windows. Are you using WSL?
When Codex runs
npm run buildas a background process, it appears that with default sandbox permissions, it cannot perform external communication and the build fails to complete.For example, Next.js's
next/font/googleattempts to fetch fonts from the network during build. With default sandbox permissions, it cannot connect to the network and the build fails.The solution is to instruct codex to
run npm run build after elevating the sandbox permissions.Once you grant permission for the elevation request, the build should complete successfully.
You are correct. Alternatively I was able to run /permissions and give it full access and it worked properly as well. Thanks for the tip. I will close this issue.
Solved by giving proper permissions to the terminal.
Giving full permission fixes it. Can I scale that back? Why doesn't it know what permissions it needs and ask for them? Am I being a prima donna?