Ignite: Ignite requires yarn even if yarn is installed correctly

Created on 28 Apr 2017  路  17Comments  路  Source: infinitered/ignite

Hey There... I have installed yarn - yarn - v shows me:
F:>yarn -v
yarn install v0.23.2
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.12s.

I am trying to create a new App with ignite but it shows me the following error:
F:>ignite new TestApp
Ignite requires yarn >=0.21.0 to be installed.

See https://yarnpkg.com/en/docs/install on how to upgrade for your OS.

What is going wrong? Hope you can help me :)

Thanks in advance - Alex

Most helpful comment

This has been giving me some trouble today, and I think I narrowed down the issue to this line of code.

I ran which yarn on my computer and got C:\Program Files (x86)\Yarn\bin\yarn.CMD. Note the spaces in the path. Ignite is essentially running the command C:\Program Files (x86)\Yarn\bin\yarn.CMD --version which fails, because it should be "C:\Program Files (x86)\Yarn\bin\yarn.CMD" --version instead.

I changed the code locally to test this out, and this line seems to work:
var result = shell.exec('"' + resolvedPath + '" ' + versionCommand, { silent: true })

All 17 comments

This has been giving me some trouble today, and I think I narrowed down the issue to this line of code.

I ran which yarn on my computer and got C:\Program Files (x86)\Yarn\bin\yarn.CMD. Note the spaces in the path. Ignite is essentially running the command C:\Program Files (x86)\Yarn\bin\yarn.CMD --version which fails, because it should be "C:\Program Files (x86)\Yarn\bin\yarn.CMD" --version instead.

I changed the code locally to test this out, and this line seems to work:
var result = shell.exec('"' + resolvedPath + '" ' + versionCommand, { silent: true })

Works fine - thanks alot :)

@andrei-livadariu - Where did you change that line of code? I'm bit by this bug as well.

Edit: Nevermind, I was able to find it. Line 83 of ~\AppData\Roaming\npm\node_modules\ignite-cli\src\cli\enforceGlobalDependency.js

Does not resolve the issue for me unfortunately.

Edit: I lied, it works. Somehow my changes to enforceGlobalDependency.js were not saved.

@andrei-livadariu - do you want to do a PR?

I wouldn't go that far :) The solution I used is just a quick hack which hasn't been tested on Linux, Mac, or any other Windows configuration. I think I would rather let someone more experienced take care of this.

works for me ... @andrei-livadariu thanks a lot

@andrei-livadariu Oops, that's my change. :/ I'll try to get this fixed soon.

Actually, I'm going to ask @kevinvangelder, our resident Windows expert, to tackle this.

The react-native packager uses shell-quote for this.

An easy workaround is to install yarn (.msi) to a dir w/o spaces, e.g.
c:\Tools\yarn works fine for me.
Still this issue might confuse/discourage new users under Windows.
Would be great if you fix it!

We have a PR, would love to help someone test it! Or @kevinvangelder - can you verify your PR works? Should only take seconds.

PR verified OK under Windows 10!
Details see PR 1010

Is this fixed in 2.0.0-beta.9?
I installed ignite by 'npm install -g ignite-cli', installed yarn by 'choco install yarn', all done in 30 mins from now and still having this issue.
And my yarn is installed in that x86 folder too.

Alright, seems not fixed yet, since issue closed 16 days ago and 2.0.0-beta.9 was released 26 days ago.

We're getting closer to releasing beta.10, but since it's the precursor to 2.0.0 we are trying to include more things. Soon!

hi, i m also hitting same issue. Have tried the solution above, none of them works for me. :( Anyone can help?

Edited: just reopen the command prompt and rerun the ignite new myApp, will fix the issue

Was this page helpful?
0 / 5 - 0 ratings