create-react-library
create-react-library copied to clipboard
Module not found on example project after deleting node_modules folders
First of all thank you for creating this amazing project. I have been using it for a while and I am really happy with this 🙂
Bug description
Unable to run example app after deleting node_modules folders
Steps to reproduce
- Create a library "@test/name" with
npx create-react-libraryand chooseTypescript - Once it's ready, delete
node_modulesfolders for both projects - Run
npm installon "@test/name" folder. Thennpm start. - On another tab, run
cd example && npm start
Expected result
To have the exmaple app running
Actual result
Failed to compile.
./src/App.tsx
Module not found: Can't resolve '@test/name' in '/Users/alvarofarina/Desktop/name/example/src'
Update
Using yarn solves the issue
This is not issues need to install yarn inside the example folder
run cd example && yarn && yarn start
Hey @durgapatra, so, 3 days ago you commented this:
I getting the same issues when clone project and yarn install not working.
Now you deleted your previous comment, downvote the issue and say something totally different. Well, I think it's an issue at least with npm and if someone ends up here it would be nice to read that they could solve the problem using yarn. What do you think?
Hi @farinalvaro I don't know if you still have this issue, but if you do, could you share your package.json for both projects?
Hi @psyycker
Sorry for the delay, I created this repo to reproduce the error: https://github.com/farinalvaro/crl-test
If I do npm i on example I get an error:
npm ERR! Maximum call stack size exceeded
Only after running yarn I'm able to generate the example/node_modules folder properly and so able to run the sandbox project.
It's happening at least with node versions 10, 12 and 14
Thank you!