Open benjaminsuch opened 6 years ago
I can confirm this, I have the same issue - my user name is c:\users\Fred Bloggs\ (not my real name :) )
Problem still appears. Helpp
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache
yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
@brandiqa unfortunately it didn't solve it to me.
λ yarn create next-app --example with-zones with-zones-app
yarn create v1.19.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app@9.0.7" with binaries:
- create-next-app
[####] 4/4'C:\Users\Spaced' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\Spaced User\AppData\Local\Yarn\bin\create-next-app
Arguments: --example with-zones with-zones-app
Directory: C:\Users\Spaced User\Desktop
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
After that:
λ yarn create next-app --example with-zones with-zones-app
yarn create v1.19.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app@9.0.7" with binaries:
- create-next-app
System cannot find the path specified.
error Command failed.
Exit code: 1
Command: C:\Yarn\Packages\bin\create-next-app
Arguments: --example with-zones with-zones-app
Directory: C:\Users\Spaced User\Desktop
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
@giovannipds What output do you get when you run:
yarn config get prefix
yarn config get cache-folder
@brandiqa hey! Thanks for getting in touch! I was so in hurry that I made it anyway, I read somewhere that if I run the command directly, it would run, so I just ran it directly:
create-next-app --example with-zones with-zones-app
And all gone well. Thanks anyway!
I found out this issue still exists, and the fix mentioned still works, but it would be nice if this could get fixed to not need a workaround
Still not working Yarn version: 2.0.0-rc.31
I can confirm this is still an issue with yarn v1.22.4
As of today, this issue still exists on yarn 1.22.4 for Windows path with spaces, e.g. C:\Users\My Name\AppData, etc, is there any permanent fix for this?
Yup, same problem here.
Same problem. Unfortunately @brandiqa's workaround didn't work for me
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
thats work for me, thanks
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
Ty, it worked like a charm.
Still failing.
Proposed solution works fine.
yarn config set cache-folder c:\root\yarn\cache
yarn config set prefix c:\root\yarn\packages
I just ran into this problem. Using yarn to install a strapi-starter gatsby blog failed. Using npx worked. I guess I will be going back to npm.
same here rename the userfolder of windows is just horrible hope for a fix
The issue stills happens nowadays... No idea about how to fix the bug?
I know this is a bad practice having username with spaces, but I cannot change this.
Options are:
Create another user with no spaces just for development.
Or
Install Windows sub system.
Dave
From: ShinProg (Logan Tann) @.> Sent: Monday, 13 September 2021 4:12 PM To: yarnpkg/yarn @.> Cc: Dave Porter @.>; Comment @.> Subject: Re: [yarnpkg/yarn] Having white spaces in your Windows username fails the "create" command (#6630)
The issue stills happens nowadays... No idea about how to fix the bug?
I know this is a bad practice having username with spaces, but I cannot change this.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/yarnpkg/yarn/issues/6630#issuecomment-917947833 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOR4WL5IOHL7JY7JCSUBOTUBWW4HANCNFSM4GBVKXYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AAOR4WJJFTUKK5VZDXETHC3UBWW4HA5CNFSM4GBVKXY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG23MLOI.gif
Can confirm. Still happening on Windows 11, and approaching 4 years since this issue was opened.
same and yes renaming username on windows is just a horrible solution :D
@daveit
The issue stills happens nowadays... No idea about how to fix the bug?
I know this is a bad practice having username with spaces, but I cannot change this.
Bad practice?!? Stop making excuses for buggy software. I've used spaces in my Win usernames for 18+ years, never have I had a single suite of software fail because of this until nodejs
/ yarn
.
Still suffering from this issue.
Hi, this works for me.
For example:
C:\Users\John Doe
Running yarn create next-app will fail with
'C:\Users\John' is not recognized as an internal or external command.
If setting cache folder for yarn and npm does not seem to work, try changing the environment variable LOCALAPPDATA which points to the app data in your home directory.
First, check 8.3 directory name with (on your terminal) dir C:\Users /x C:\Users\John should look like C:\Users\JOHN~1.
Then, set the environment variable with (on your terminal) set LOCALAPPDATA=C:\Users\JOHN~1\AppData\Local Now, yarn create should work.
link to original https://stackoverflow.com/questions/54379046/yarn-gives-error-when-creating-react-application
Yep this error still up after 4 years
I had same problem.
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
It worked for me :) I surround path with quotation. (\'{path}\')
yarn config set cache-folder 'c:\root\yarn\cache'
yarn config set prefix 'c:\root\yarn\packages'
Why is this still not fixed? How is it reasonable to expect the user to implement some cache folder hacks in order to get elementary functionality out of yarn? This is preposterous.
Why is this still not fixed? How is it reasonable to expect the user to implement some cache folder hacks in order to get elementary functionality out of yarn? This is preposterous.
This is one of the reasons I try to avoid JS and its ecosystem as much as possible.
Faced the same issue today. It's 2022 and issue is still open 😞. Had to use this workaround. This works!
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
I had same problem.
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
It worked for me :) I surround path with quotation. ('{path}')
yarn config set cache-folder 'c:\root\yarn\cache' yarn config set prefix 'c:\root\yarn\packages'
This worked for me thanks
@brandiqa yarn config set cache-folder 'c:\root\yarn\cache' yarn config set prefix 'c:\root\yarn\packages'
it worked for me, Thanks a lot for sharing
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
@brandiqa Thanks man, finally its works.
it still here !
@giovannipds What output do you get when you run:
yarn config get prefix yarn config get cache-folder
Thanks it works for me.
just i am trying npm to yarn but this user name containing space give same failed message , when I want to create next-app , it is 2023. so no any option to use yarn , I decided to still I will use npm.
@aabmets I appreciate your suggestions, but I'm not sure why you had to be so rude about Yarn. It's still a popular package manager, and I think it's not "dead." I've tried pnpm before and I'm not familiar with Bun, but I'll check it out.
Thank you for your help.
I had same problem.
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
It worked for me :) I surround path with quotation. ('{path}')
yarn config set cache-folder 'c:\root\yarn\cache' yarn config set prefix 'c:\root\yarn\packages'
This also worked for me, only when I added in the quotations.
I had same problem.
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
It worked for me :) I surround path with quotation. ('{path}')
yarn config set cache-folder 'c:\root\yarn\cache' yarn config set prefix 'c:\root\yarn\packages'
This also worked for me, only when I added in the quotations.
So after looking at this, if you set it to "\"
this probably treats it as a character escape in some CLIs. I use bash and it tried to remove all of the "\"
. So either adding the " "
or using "/"
instead is the safest option.
I had same problem.
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
It worked for me :) I surround path with quotation. ('{path}')
yarn config set cache-folder 'c:\root\yarn\cache' yarn config set prefix 'c:\root\yarn\packages'
This is still a problem in 2024. The solution above worked for me! Thank you @tkhashi
@Cassiocominetti Just a question. Its your yarn in the version 4? Just asking bc for me every time yarn install version 2 by default.
@Cassiocominetti Just a question. Its your yarn in the version 4? Just asking bc for me every time yarn install version 2 by default.
@Willienn yarn version v1.22.19
@Cassiocominetti if changing the version inst a problem, give v4 a try and see if it works better, its fixes a lot of bugs for me.
(IDK why the installer dnst install the 4v by default)
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
This worked fine to me on yarn v1.22.22 edit: Anyways it should be fixed, but as a temporal fix if it works it works
Here 's a workaround I've used:
yarn config set cache-folder c:\root\yarn\cache yarn config set prefix c:\root\yarn\packages
Basically configure yarn not to use folders inside your USER folder.
This worked fine to me on yarn v1.22.22
This isn't a solution. Paths containing usernames with spaces and special characters should be escaped.
Same issue here and wondering why this isn't being solved till now?
I have a same issue. Do you have a plan how can you fix it? Thanks
I have a same issue. Do you have a plan how can you fix it? Thanks
https://github.com/yarnpkg/yarn/issues/6630#issuecomment-1999841259
This worked here! =) @vegerta @aburifat
As the title specifies I'm not able to run the create command since I have a white space in my username on Windows. In this case it says "Can't find the command C:\Users\Benjamin".
Yarn version: 1.12.1 Node version: 10.13.0