PlainError

npm ERR! code ENOENT

Last checked 2026-11-27 · 3 fixes · AI-drafted, auto-reviewed · how we write fixes

TL;DRThis npm error means the tool cannot find a file or folder it expects, such as package.json or a dependency path, so the command stops.

Most likely cause: The current folder has no package.json or the file was deleted or moved

Try first: Check what files exist in the current folder (ls -la)

Likely causes

  1. The current folder has no package.json or the file was deleted or movedmost likely
  2. A script or config points to a non-existent file or directory pathpossible
  3. npm is running from the wrong working directoryless likely

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Check what files exist in the current folderSafe

    Open a terminal in the project folder and list the files to see if package.json is present.

    ls -la
  2. Navigate to the correct project folderSafe

    Use the cd command to move into the folder that contains your package.json before running npm commands.

    cd /path/to/your/project
  3. Create a missing package.jsonChanges settings

    If the file is absent, initialize a new one with npm init. This will not overwrite existing files if you answer the prompts carefully.

    npm init

If that didn't fix it

Run the npm command again after adding --verbose to see the exact missing path mentioned in the full error output

When to see a technician

Contact the project maintainer or a Node.js developer if the error occurs inside a shared repository or after a fresh clone.

Did this fix it? Report a problem

Related errors

All Coding errors →