#57 most commondependenciesBolt.newReplitCursorWindsurf

npm ERR! enoent Could not read package.json

npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /home/project/package.json npm ERR! enoent Could not read package.json

Got a slightly different error? Paste the exact message and get a fix prompt tailored to it.

Paste your error →

What it means

The terminal is running in a folder that doesn't contain your project's main settings file. Either you're in the wrong folder or the file never got created.

How to fix it: paste this prompt into your AI builder

Fix prompt for Bolt, Cursor, Replit, Windsurf
npm can't find package.json. Check which folder is the project root and whether package.json exists. If the app lives in a subfolder, set the commands (and deploy root directory) to that folder. If package.json is missing, recreate it with the dependencies the code imports and the correct dev/build scripts. Don't modify app code.

If the AI can't fix it: manual steps

  1. Type 'ls' in the terminal to see files; if your project is inside a subfolder, 'cd' into it first.
  2. On Vercel/Netlify, set the Root Directory / Base directory to the subfolder that contains package.json.

Where this happens

Seen in these AI app builders and editors:

Bolt.newReplitCursorWindsurf

Sources

Related dependencies errors

Still stuck? Paste your full error and UnstuckMyVibe will match it and hand you the exact fix prompt.

Fix my error →