Peer/Dev Dependency Resolution Error
See original GitHub issueI have two packages in my monorepo, one of which dev-depends and peer-depends on the other. For this example, I’ve swapped out the real names with a
and b
.
a/package.json
{
"name": "a",
"version": "0.1.0",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"license": "Apache-2.0"
}
b/package.json
{
"name": "b",
"version": "0.1.0",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"license": "Apache-2.0",
"devDependencies": {
"a": "^0.1.0"
},
"peerDependencies": {
"a": "^0.1.0"
}
}
Upon bootstrapping I encounter the following error:
lerna ERR! npm install exited 1 in 'b'
lerna ERR! npm install stderr:
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: a@undefined
npm WARN node_modules/a
npm WARN peer a@"^0.1.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer a@"^0.1.0" from the root project
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/a - Not found
npm ERR! 404
npm ERR! 404 'a@^0.1.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
It appears that––for some reason––the version of a
is undefined
, hence the package is not resolved. Because the package does not exist on NPM, the installation fails altogether.
Any help / advice would be greatly appreciated! Thank you!
lerna.json
{
"$schema": "https://json.schemastore.org/lerna",
"npmClient": "npm",
"packages": ["packages/*"],
"version": "0.1.0"
}
Your Environment
Executable | Version |
---|---|
lerna --version |
3.22.1 |
npm --version |
7.5.2 |
node --version |
14.15.5 |
OS | Version |
---|---|
macOS Catalina | 10.15.7 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12
Top Results From Across the Web
you must install peer dependencies yourself Code Example
npm WARN codelyzer@6.0.1 requires a peer of tslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
Read more >rushstack/rushstack - Gitter
ERROR: Internal Error: Could not find peer dependency '@babel/core' that satisfies version '*' You have encountered a software defect.
Read more >If a node module includes its own package-lock.json, is that ...
I have a repository that has a bunch of peer dev dependencies (this repo is a standalone eslint config, like airbnb).
Read more >Core Package Changelog - Twilio Paste
[Code Block] add missing peer/dev dependencies ... [Animation Library] Updates React Spring dependencies to resolve bug with RequestAnimationFrame calls.
Read more >The npm Blog on Tumblr
Included are several bug fixes that our wonderful users reported to us, ... text for ERESOLVE errors, because "unable to resolve dependency tree"...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you’re using npm 7+ now, you just have to add
"useWorkspaces": true
to your lerna.json as npm has similar behaviour to yarn now.npm install --legacy-peer-deps
lets my install pass without error. Environment: npm v7 on Windows.