Skip to content
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

help,help,please...global bin #6234

Open
steady-join opened this issue Aug 6, 2018 · 5 comments
Open

help,help,please...global bin #6234

steady-join opened this issue Aug 6, 2018 · 5 comments
Assignees
Labels

Comments

@steady-join
Copy link

node version:10.6.0
win10
$ yarn global add create-react-app --prefix /usr/local
yarn global v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-react-app@1.5.2" with binaries:
- create-react-app
Done in 1.89s.

$ create-react-app 1
/bin/sh: /usr/local/bin/C:/Users/lenovo/AppData/Local/Yarn/Data/global/node_modules/.bin/create-react-app: No such file or dire

@ghost ghost assigned torifat Aug 6, 2018
@ghost ghost added the triaged label Aug 6, 2018
@johannes-scharlach
Copy link

That prefix doesn't look like it's meant for windows. Why do you need a prefix anyways?

@abhnvkmr
Copy link

abhnvkmr commented Aug 6, 2018

Same thing is happening with me on Ubuntu. Even though yarn global bin returns ~/.npm-global/bin, the binaries are being installed into ~/.yarn/bin.

@xianghongai
Copy link

windows 10 : $ sysdm.cpl - Advanced - Environment Variables - System variables - PATH - New - %LocalAppData%\Yarn\Data\global\node_modules\.bin\ - restart Command Prompt

@ashfaqnisar
Copy link

I had this same issue.

Little Bit Explanation About My Issue:
So i just installed the npm & yarn using the MSI installer and I changed the environmental variable to the bin of the yarn installed folder.

Now when i call the yarn with any command. Like given below:

yarn create react-app test4

I used to receive this following error

yarn create v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-react-app@3.1.0" with binaries:
      - create-react-app
'C:\Users\user-name' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\user-name\AppData\Local\Yarn\bin\create-react-app
Arguments: test4
Directory: C:\Users\user-name
Output:

Solution:
Now, when you call the yarn command. It was calling the yarn present in the bin folder of MSI installer but, yarn actually creates another yarn folder in c drive: C://users/user-name/appdata/local/yarn/bin
This folder contains the bin which will handle all the commands.

So, just go to environmental variables and change the PATH variable to C://users/user-name/appdata/local/yarn/bin

@ashfaqnisar
Copy link

I had this same issue.

Little Bit Explanation About My Issue:
So i just installed the npm & yarn using the MSI installer and I changed the environmental variable to the bin of the yarn installed folder.

Now when i call the yarn with any command. Like given below:

yarn create react-app test4

I used to receive this following error

yarn create v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-react-app@3.1.0" with binaries:
      - create-react-app
'C:\Users\user-name' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\user-name\AppData\Local\Yarn\bin\create-react-app
Arguments: test4
Directory: C:\Users\user-name
Output:

Solution:
Now, when you call the yarn command. It was calling the yarn present in the bin folder of MSI installer but, yarn actually creates another yarn folder in c drive: C://users/user-name/appdata/local/yarn/bin
This folder contains the bin which will handle all the commands.

So, just go to environmental variables and change the PATH variable to C://users/user-name/appdata/local/yarn/bin

I know this is not the solution for the issue created. But, i found this issue while searching the problem. Hope, this thing help you. I know that issue was foolish but still it gave me a very hard time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants