npm looked for node_modules but it does not exist yet (fresh checkout, cleaned workspace, or wrong working directory). Install dependencies or point npm at the correct folder.
npm expects node_modules to exist after installs and when resolving binaries. If you run scripts before installing dependencies, mount an empty volume over the project, or execute in the wrong directory, stat on node_modules fails with ENOENT. CI pipelines that clean workspaces, Docker bind mounts that shadow the folder, and monorepos with nested packages commonly see this when running npm run before npm install.
pwd
ls node_modules 2>/dev/nullnpm ci
# or
npm installEnsure your container workdir matches the project root and that you are not mounting an empty host folder over node_modules.
If using workspaces, run npm inside the specific package that owns node_modules or enable workspaces at the root.
CI best practice is npm ci after checkout and before running scripts; cache node_modules cautiously to avoid stale/empty mounts. Docker Compose often mounts the repo; build a layer that installs dependencies, or mount only source and keep node_modules inside the container image. With pnpm/yarn workspaces, node_modules may be hoisted—ensure your script runs where they are present.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm run <script>