Codex unable to run simple npm commands on the workspace

Resolved 💬 5 comments Opened Oct 29, 2025 by urecio Closed Jan 17, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.50.0

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex

What platform is your computer?

MacOS x64 (Ventura)

What issue are you seeing?

I have asked the agent to run commands like "npm run dev", and they always get "failed in sandbox: Operation not permitted"

What steps can reproduce the bug?

Uploaded thread: 019a30d4-ea41-71c1-9cac-fc7e230b6921

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5849

Powered by Codex Action

samcharles93 · 10 months ago

Having the same issue, using nvm, even in full-approval mode still not able to use npm/node commands or go commands. doesn't ask for approval just fails.

facelezzzz · 10 months ago

Having the same issue, “Operation not permitted” when "mvn -q -DskipTests compile"

Mikkolehtimaki · 9 months ago

Same here, npm: command not found.

In fact, no programs installed with npm are available to codex. I've tried different options for [shell_environment_policy]
to no avail. Everything works with tools like Copilot and Gemini CLI and Claude Code.

etraut-openai contributor · 7 months ago

Closing out old bugs.