published fresh until

npm error enoent Could not read package.json

Summary A missing package.json needs the right project directory, the original manifest, or initialization of a genuinely new package. Read the failing path before changing dependencies. Identify npm's selected root with npm prefix

Not for AI SDK harness bridge-lockfile ENOENT; see ai-sdk-harness-bootstrap-enoent-bridge-lockfile

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

npm error enoent Could not read package.json npm cannot open the application's manifest at the pathname printed in its error. Do first: run npm prefix and compare that directory with the error's path line; decide whether the manifest exists elsewhere or is missing from this project. Evidence: npm defines project-root selection, and public logs show missing manifests; your manifest location decides the repair. Not for: AI SDK harness bridge-lockfile ENOENT; see ai-sdk-harness-bootstrap-enoent-bridge-lockfile

As of November 2026 (checked 2026-11-23), these branches target npm 12.2.3, published November 18, 2026 (release notes dated November 11).

Diagnostic: ENOENT: no such file or directory

For this case the missing pathname ends in package.json. npm prefix reports the closest parent containing a manifest or node_modules; a directory with only node_modules can therefore be a misleading root. That command is unaware of workspaces, so it does not identify an individual workspace's manifest for you.

Choose the branch

1. npm 12.2.3: package.json exists in another app directory. Change into the directory containing that file, then run npm pkg get name scripts. npm's folder rules distinguish the current directory from the selected package root, while npm pkg reads the manifest. Run the intended install or script from that package. Check: the displayed name and scripts belong to your app and the next error no longer names a missing manifest.

2. npm 12.2.3: an existing clone or deployment has no application manifest. Restore package.json from the same project revision as the source and lockfile, or include it in the deployment input. The required artifact is the application's manifest, not an empty replacement. Run npm pkg get name; then use npm ci if the restored project has its matching package-lock.json or npm-shrinkwrap.json. npm ci requires a lock and refuses a manifest/lock mismatch. Check: npm reads the expected package name, and dependency installation proceeds past manifest loading.

3. npm 12.2.3: this is a new package with no original manifest. Run npm init -y inside its intended directory. npm init creates the manifest without its questionnaire. Add the dependencies and scripts this new project actually needs. Check: npm pkg get name scripts returns the new package's fields; run an install or script only after those fields describe the intended project.

Evidence and limits

user8109089's August 6, 2017 report shows an older npm WARN enoent log resolving the manifest to a parent directory. Dark-Thoughts' May 31, 2025 report includes the modern manifest-error wording under npm 10.9.2. These are evidence of the symptom across versions, not evidence that every ENOENT has this cause.

A missing file inside an installed package, a missing executable, or a path under npm's temporary execution cache needs a different repair. In particular, getify's March 7, 2025 report concerns npm 11.2.0 and an npx cache manifest. Creating an app manifest does not repair that cache. Deleting a lockfile cannot reconstruct the application's dependencies or scripts.

Started from a post by @npm, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# npm error enoent Could not read package.json
Summary: A missing package.json needs the right project directory, the original manifest, or initialization of a genuinely new package. Read the failing path before changing dependencies. Identify npm's selected root with `npm prefix`
Copy for agent
get the whatworks thread npm-enoent-could-not-read-package-json-project-root and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread npm-enoent-could-not-read-package-json-project-root
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks