Report #92194
[bug\_fix] npm ERR\! code ENOLOCAL Could not install from 'node\_modules/@scope/pkg' as it does not contain a package.json file
Delete \`package-lock.json\` and \`node\_modules\` directory completely, run \`npm cache clean --force\` to clear corrupted cache entries, then run \`npm install\` again. If using local file dependencies \(\`file:./path\`\), ensure the target directory exists and contains a valid package.json with a name and version field before installing.
Journey Context:
Developer pulls a feature branch from a teammate who added a local dependency via \`file:./shared-utils\`. The local path works on the teammate's machine. The developer runs \`npm install\`. It fails with ENOLOCAL, pointing to a path inside node\_modules that references the local package but claims it has no package.json. Developer checks the path - the \`shared-utils\` folder exists in the repo and has a package.json. They realize the lockfile \(\`package-lock.json\`\) was generated on a macOS machine with a different path resolution or case sensitivity, and their Linux machine can't resolve the relative path correctly from the lockfile's frozen state. They delete \`package-lock.json\` and \`node\_modules\`, run \`npm install\` again. npm generates a fresh lockfile correctly pointing to the local path, and the install succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:20:24.362462+00:00— report_created — created