Yarn: cannot run yarn create if yarn is in a folder where the file path has a space

Created on 24 Dec 2018  路  5Comments  路  Source: yarnpkg/yarn

Yarn v1.12.3
my laptop (helpfully, thank you windows) installed yarn by default in a directory where the file path includes a space (e.g. C:/Users/Some Name/AppData/Yarn...).
This results in the following error when I run yarn create react-app

'C:\Users\Some' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\Some Name\AppData\Local\Yarn\bin\create-react-app
Arguments:
Directory: C:\repos\beaver
Output:
triaged

Most helpful comment

It's been a year now, can we get an update on this?

All 5 comments

Just spent an hour on this very issue until realizing this was the cause - spaces in the profile name.

If easy, putting quotes around the command would resolve it and still work with non-spaced paths

It's been a year now, can we get an update on this?

You need to change the cache to a location without spaces.

yarn config set cache-folder "your path without spaces"

Did work for me!! If this solve your problems, let me know!

I also had to change the prefix

yarn config set prefix "your path without spaces"

6630

Was this page helpful?
0 / 5 - 0 ratings