imports do not find packages linked via 'yarn link'
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes 1.3.2
Which terms did you search for in User Guide?
failed to compile for yarn linked packages cannot resolve local packages module not found when importing npm linked pacakges
Environment
yarn --version 1.3.2 node -v v8.9.1 npm -v 5.5.1 yarn --version 1.3.2 npm ls react-scripts └── react-scripts@1.0.17
Then, specify:
- Operating system: OSX 10.13.1
- Browser and version (if relevant): FF, Chrome, Safari
Steps to Reproduce
(Write your steps here:)
- Clone a module (i.e. https://github.com/jakezatecky/react-checkbox-tree )
- cd into that directory
- yarn link
- cd into main project
- yarn link ‘react-checkbox-tree’
- Add import CheckboxTree from ‘react-checkbox-tree’; to a component
- Run
Expected Behavior
It should resolve the module.
Actual Behavior
I see the module is symlinked within node_modules, but the app is looking only relative to the component:
Failed to Compile Module not found: Can’t resolve ‘react-checkbox-tree’ in ‘/Users/un/gd/client/src/modules/categories/components’
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
yarn link
yarn link (in package you want to link) This command is run in the package folder you'd like to consume. For example if...
Read more >Import from `yarn link` packages not working - Stack Overflow
I have a package structure as follows -> projectA -> libA ->dist/ ->index.js index.ts package.json. I compiled the package libA using ...
Read more >How to yarn link when the package is not published?
There's a problem. This only works if you've previously published the package to an npm compatible repository because when you run yarn in...
Read more >Support resolve and auto import for npm linked packages
Open the project - web40509-npm-link -> cd pkg6 -> npm link · Open the attached project - npm-link-test1. · Try to import pkg6...
Read more >How to Test npm Packages Locally - Alyssa Holland's Blog
yarn link is a CLI command that allows developers to link a package in ... dependencies linked in this way are not saved...
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
It is failing because the main entry of
react-checkbox-tree
points tolib/index.js
. But that file doesn’t exist if you just clone a repository.If you run
yarn build
inreact-checkbox-tree
, that will create thelib
folder. If you manage to get it building (I had to remove linters from the gulpfile because they failed for me), linking will work.Oh … thank you @bugzpodder