-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Yarn #896
Comments
Yep. If somebody wants to implement this please comment in this issue so we don't duplicate effort. |
(Let's not install yarn, but let's detect it.) |
I'm going to work on this. |
I just did some quick testing with yarn and create-react-app, and found a problem:
Manually running Yarn does seem to set things up correctly:
I added
That looks legit to me, so I'm not sure why everything is failing. Smells like either a yarn problem, or something strange in my environment. Either way, I thought it was worth documenting here for folks looking into yarn and create-react-app interactions. |
@notahat For me that works without problems and |
@fson Interesting. I'm on Node 4. I'll keep digging and see what I find. |
I can confirm I'm seeing the same exact error, and I did the same exact thing as @notahat (down to the I tried the other variations like |
Yep, I just tested on 6.7.0 and had the same problem. Also MacOS 10.12. |
Ok, I tried with a fresh Node installation on another laptop and was able to reproduce the issue with the same commands as @notahat. I'll dig deeper in the morning, unless someone finds out why it doesn't work before then. |
Note you'll need to update the create react app global cli to use yarn instead of npm if available, otherwise cra will keep shelling out to npm and the install time will be slow. |
I can see what's going on, although I'm not sure why yet. I added this to my scripts:
So that works! So with |
Please file an issue in Yarn? |
@cpojer Yup, my plan is to check if the On Wed, 12 Oct 2016 at 02:36 Christoph Pojer <
a, pre, code, a:link, body { word-wrap: break-word !important; } Note you'll need to update the create react app global cli to use yarn instead of npm if available, otherwise cra will keep shelling out to npm and the install time will be slow. — You are receiving this because you were mentioned. Reply to this email directly, |
This is great. Use install getstorybook globally using yarn:
Then after that |
@notahat Why are you running Your shell complains about:
and not
Seems the error is on your side. |
Looks like this got fixed with yarnpkg/yarn#809 |
as per today @ben174 it was merged to |
Not sure if this is the appropriate place, or whether I should create a separate issue, but running tests (via I got the following error:
Setup:
|
A simple bash detection script might be the easiest solution: if which yarn > /dev/null; then
yarn
else
npm install
fi |
@ShMcK it should work on Windows too. |
I assumed bash might do, looking at the tasks directory, but now I see that's just for build, release and testing. You're right. Though I would assume there is an equally simple if/then detection script for windows. |
I implemented the detection by simply trying to start |
Just wanted to confirm that homebrew now has yarn v0.16.0, which I wasn't able to do as of yesterday So, I was able to run
Seems like it was fixed by this PR: yarnpkg/yarn#809 |
Yep, can confirm that it's solved in 0.16.0 for me. |
What is the status of |
Fixed by #898. |
Is this possibly something to do with the mac ports install location at yarn version 0.22.0 |
@Shongololo could you give the full error message you get from create-react-app and the output of following commands on your system:
|
@fson this is the error message:
for the versions:
whereas |
Even if you have Yarn I'd still recommend installing npm. As I understand the program crashes when it falls back to npm. Many other programs will assume npm exists. In your particular case please create a symbolic link from |
https://github.com/yarnpkg/yarn
We released Yarn, a faster alternative to the npm client. Can
create-react-app
detect when yarn is installed (or install yarn?) for faster app creation?The text was updated successfully, but these errors were encountered: