pnpm: pnpm cannot add dependency to workspace project on windows: Cannot destructure property 'manifest' of 'manifestsByPath[rootDir]' as it is undefined.
Trying to add a dependency while in a package’s subdirectory of pnpm workspace:
pnpm version:
8.4.0
Code to reproduce the issue:
- cd to subproject of a pnpm repo
pnpm i vite-plugin-static-copy(any package)
Expected behavior:
pnpm should install the package in the current workspace project
Actual behavior:
$ pnpm i vite-plugin-static-copy ERROR Cannot destructure property ‘manifest’ of ‘manifestsByPath[rootDir]’ as it is undefined.
pnpm: Cannot destructure property ‘manifest’ of ‘manifestsByPath[rootDir]’ as it is undefined. at C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:189340:19 at async Promise.all (index 0) at async recursive (C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:189337:9) at async installDeps (C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:189727:11) at async C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:216935:21 at async main (C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:216902:34) at async runPnpm (C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:217157:5) at async C:\NVM\nvm\versions\node\v18.12.1\bin\node_modules\pnpm\dist\pnpm.cjs:217149:7
Additional information:
node -vprints: v18.12.1- Windows, macOS, or Linux?: Windows, git bash and cmd same result.
- may or may not be related to #4904
- cd to workspace root and using --filter works
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 16 (2 by maintainers)
Commits related to this issue
- fix: normalize cwd on Windows close #6524 — committed to pnpm/pnpm by zkochan 4 years ago
- fix: normalize cwd on Windows (#6525) close #6524 — committed to pnpm/pnpm by zkochan 4 years ago
- fix: normalize cwd on Windows (#6525) close #6524 — committed to pnpm/pnpm by zkochan 4 years ago
- fix: use real path for module root dir (#6524) (#7491) close #6524 — committed to pnpm/pnpm by grimly 3 years ago
- fix: use real path for module root dir (#6524) (#7491) close #6524 — committed to pnpm/pnpm by grimly 3 years ago
What did I miss? I see many people reporting this problem for about 3 years now, across many versions. And the solution is just (Issue is closed, try producing a minimal scenario)?
The issue is still present on version
8.14.0.I managed to identify the issue.
I’ll submit a PR soon enough.
pnpm v9.10.0, same issue.
This issue suggests it’s a Windows issue (I’m Win 11 Home)
A reboot works, thanks @BearToCode for the tip:
Also on 9.4.0
I got this error after cancelling an installation, which probably broke something. I just had to restart my PC for it to start working again. Just an heads up to save someone a bit of time