npm 5 link / lerna resolve issue
See original GitHub issueTell us about your environment
- ESLint Version:
4.13.1
- Node Version:
8.9.3
- npm Version:
5.6.0
What parser (default, Babel-ESLint, etc.) are you using? default
Issue: When using Lerna with npm v5, eslint is unable to correctly resolve linked packages.
Example Repo: chrisblossom/eslint-issue-9746
Updated repo to include both scoped and non-scoped example.
What actually happened? Please include the actual, raw output from ESLint.
➜ example git:(master) eslint index.js
Cannot find module '@chrisblossom/eslint-config'
Referenced from: /Users/chris/github/eslint-issue-9746/packages/example/.eslintrc.js
Error: Cannot find module '@chrisblossom/eslint-config'
Referenced from: /Users/chris/github/eslint-issue-9746/packages/example/.eslintrc.js
at ModuleResolver.resolve (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/util/module-resolver.js:74:19)
at resolve (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config/config-file.js:471:25)
at load (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config/config-file.js:542:26)
at configExtends.reduceRight (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config/config-file.js:421:36)
at Array.reduceRight (<anonymous>)
at applyExtends (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config/config-file.js:403:28)
at loadFromDisk (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config/config-file.js:514:22)
at Object.load (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config/config-file.js:550:20)
at Config.getLocalConfigHierarchy (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config.js:228:44)
at Config.getConfigHierarchy (/Users/chris/github/eslint-issue-9746/node_modules/eslint/lib/config.js:180:43)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:11 (5 by maintainers)
Top Results From Across the Web
@lerna/link - npm
Start using @lerna/link in your project by running `npm i @lerna/link`. There are 4 other projects in the npm registry using @lerna/link.
Read more >Setting up a monorepo with Lerna for a TypeScript project
To install necessary dependencies from npm, or link ones from the monorepo, use the lerna add command from the root of the project....
Read more >Unable to resolve dependency tree error when installing npm ...
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force , or --legacy-peer ......
Read more >@lerna/link | Yarn - Package Manager
json. (Please let us know via a Github issue if you feel the need to do that, however, as in general the new...
Read more >How to fix NPM link duplicate dependencies issues
This post is about an issue that keeps coming on several of my projects involving third-party libraries linked locally with npm link: ...
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
I do not think this issue should be closed. I still think this is a bug and eslint should work as expected with npm link/lerna without additional configuration. I’ve updated the example repo with a babel example that works as expected.
This is happening because lerna is installing
eslint
and your scoped config into two different locations. ESLint needs to be able to resolve your shareable config from the location of ESLint itself.