-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Cannot use CRA to create a new yarn workspace/package #3405
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yea, we should really figure out a Workspaces integration. Also as a solution to the "absolute imports" problem. |
@gaearon I tried to use PS. Thanks for the quick reply! 🚀 |
In case anyone is stuck with this and until the different issues are fixed, I made a little guide on how to use yarn workspaces with Create React App and Create React Native App (Expo) to share common code across. Hope you find it handy! |
@dariocravero - thats the workaround I've gone with, creating in a tmp location and copying into the yarn workspaces structure. In addition to removing node_modules, you may want to also remove yarn.lock as I believe with workspaces all package locks are managed in the top-level lockfile? I could be mistaken though, I came to this conclusion when running |
That's a good point @mattfysh, thanks! Updated the guide :) |
Seems like a duplicate of #3031. |
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
No
Which terms did you search for in User Guide?
Environment
node -v
: v8.7.0npm -v
: 5.5.1yarn --version
(if you use Yarn): 1.2.1npm ls react-scripts
(if you haven’t ejected): N/A (happens on init)Then, specify:
Steps to Reproduce
(Write your steps here:)
mkdir cra-issue && cd cra-issue
yarn
create-react-app packages/app-a
Expected Behavior
A new CRA application to be initialized under
packages/app-a
Actual Behavior
Reproducible Demo
Use steps above
The text was updated successfully, but these errors were encountered: