'pnpm workspaces does not allow installing of dependencies on brand new projects `cannot read properites of undefined (reading 'manifest')`
I'm trying to use pnpm with lerna to create a monorepo. Unfortunately it all fails when attempting to install lerna itself via pnpm.
Current project structure:
lerna.json contents:
{
"packages": ["functions/*", "libs/*"],
"version": "0.0.0",
"npmClient": "pnpm",
"publish": {
"ignoreChanges": ["ignored-file", "*.md"],
"message": "chore(release): publish",
"registry": "https://npm.pkg.github.com"
},
}
package.json contents:
{
"name": "roci-backend",
"private": true,
"version": "0.0.0"
}
and finally, the pnpm-workspace.yaml:
## include
- "functions/**"
- "libs/**"
pnpm version: 7.0.1
node version: 16.15.0
OS: win 10
Error message:
❯ pnpm add -D -w lerna
ERROR Cannot read properties of undefined (reading 'manifest')
Stack trace:
"stack": "pnpm: Cannot read properties of undefined (reading 'manifest')\n at C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:120885:49\n at Array.map (<anonymous>)\n at C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:120882:39\n at Array.map (<anonymous>)\n at getImporters (C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:120878:34)\n at recursive (C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:120900:31)\n at async handler (C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:121294:11)\n at async C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:176187:21\n at async run (C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:176161:34)\n at async runPnpm (C:\\Users\\Seb\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\[email protected]\\node_modules\\pnpm\\dist\\pnpm.cjs:176379:5)"
I have also tried installing many other older versions, as old as 5.xx, but the exact same error persist.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

