npm is being run in a directory without package.json or the path is wrong (moved repo, case mismatch, or missing checkout). Switch to the project root or recreate package.json.
npm needs package.json in the current working directory to know what to install or run. If you run npm from the wrong folder, or package.json was deleted/ignored, the fs open call fails with ENOENT and npm exits. This also appears in CI when the working directory is mis-set, when sparse/partial checkouts skip package.json, or on case-insensitive filesystems where path casing differs from git metadata.
pwd
ls package.jsonIf missing, cd to the directory that contains package.json.
git status -- package.json
ls -l package.jsonRestore it if deleted or ignored.
Set the job working directory to the repo root (e.g., uses: actions/checkout with working-directory, or docker run -w /app).
npm init -yMonorepos place package.json in subpackages; ensure you run npm from the package folder or use workspaces. In CI with sparse checkout, include package.json in the sparse set. On macOS/Windows, case-insensitive filesystems can hide casing mistakes—keep the exact lowercase name. If using npm link, confirm the linked package still has its own package.json.
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 ci