/errors/pnpm/err-pnpm-no-pkg-manifest
ERR_PNPM_NO_PKG_MANIFEST No package.json found in ...
verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
- tool
- pnpm
- exit code
- 1
- versions
- pnpm 8 – 10
- os
- any
ERR_PNPM_NO_PKG_MANIFEST No package.json found in /path means pnpm looked for a project manifest (package.json, package.yaml or package.json5) in the current directory and found none. Change into the project folder that contains package.json and run the command again, or create a manifest with pnpm init if this is a new project.
Reproduce it
mkdir empty && cd empty
npx --yes pnpm@9 installOutput · exit 1
ERR_PNPM_NO_PKG_MANIFEST No package.json found in /tmp/work/empty
Fix
mkdir -p app && cd app
npx --yes pnpm@9 init > /dev/null
ls
cd ..
npx --yes pnpm@9 --dir app install > /dev/null 2>&1
echo "install exit=$?"Output
package.json install exit=0
pnpm --dir PATH (short -C PATH) runs pnpm as if it had been started in PATH, which is handy in CI scripts.
In CI and Docker
| Environment | What to check |
|---|---|
| GitHub Actions | defaults.run.working-directory or working-directory on the step points to the folder with package.json |
| GitLab CI | cd into the project subfolder in script, or set the job to run there |
| Docker | WORKDIR /app, then COPY package.json pnpm-lock.yaml ./ before RUN pnpm install |
| Monorepo | Run pnpm install from the workspace root (where pnpm-workspace.yaml is) |
npm prints the same situation as ENOENT: no such file or directory, open '.../package.json'.
Sources
Related pages
errors · npmnpm error code ENOENT: Could not read package.jsonnpm fails with ENOENT Could not read package.json when run in a folder without package.json. cd into the project root, or create one with npm init -y.errors · pnpmERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to dateERR_PNPM_OUTDATED_LOCKFILE means package.json changed but pnpm-lock.yaml was not regenerated, and CI installs with frozen-lockfile. Run pnpm install and commit.commands · pnpmpnpm --filter: run a script in one workspace packagepnpm --filter PKG run build runs a script only in the matching workspace packages. Add ... to include dependencies, use globs, directories or "[origin/main]".