Yarn: Command not found create-react-app on ubuntu

Created on 4 Jan 2018  路  16Comments  路  Source: yarnpkg/yarn


Version of yarn
v1.3.2

Do you want to request a feature or report a bug?
bug

What is the current behavior?
creact-react-app command not found

If the current behavior is a bug, please provide the steps to reproduce.
yarn global add create-react-app
yarn global v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
Done in 3.05s.

which create-react-app
create-react-app command not found

Try to add the yarn global bin path to my global path. It is also not working.
My global path - export PATH=$PATH:~/.yarn/bin

Try to check if the create-react-app is included on the the yarn global dir. It is included.
But when I checked the bin folder, the create-react-app script is not exist. Other scripts are exist.

What is the expected behavior?
create-react-app should work.

Please mention your node.js, yarn and operating system version.
node - v9.3.0
yarn - v1.3.2
ubuntu - 16.04
shell - zsh

triaged

Most helpful comment

If you read carefully then you will see after installing Yarn it tells you to add the following thing in your path.

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

~/.yarn/bin is for yarn binaries only.

All 16 comments

Please can you show me the out of this commands

ls .config/yarn/global/node_modules/.bin
./.config/yarn/global/node_modules/.bin/create-react-app
ls .yarn/global/node_modules/.bin
./.yarn/global/node_modules/.bin/create-react-app

When I try to execute this command ls .config/yarn/global/node_modules/.bin
the create-react-app package is exist.

But on this command ls .yarn/global/node_modules/.bin
global dir is not exist. All my packages installed as global are on the directory of .yarn/bin. But create-react-app is not stored on the bin dir. I can access the scripts which are on the .yarn/bin.

yarn global add create-react-app

I also tried to add the path of .yarn/bin to my shell config but its not working. The issue here is when I installed the create-react-app, the shell script is not included on the .yarn/bin. But it is included on the yarn global dir. Its pretty weird because I noticed that this bug is produced only in create-react-app package.

How is your shell?

Send me the output of create-react-app

yarn global add create-react-app
yarn global v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-react-app
Done in 3.05s.

which create-react-app
create-react-app command not found

When I tried to install using npm global its working. I know that this issue is old but I thought that it is fix now. Im using zsh shell .

~/.yarn/bin/create-react-app

Thanks for the help but I already add the the path of yarn/bin on my global path. The problem is when I try to install the create-react-app, the create-react-app script is not exist on the yarn/bin dir. But others packages which I installed using yarn are included on the yarn/bin dir. What I know is that the create-react-app must be included on the yarn/bin when installing the package.

Then your not have your yarn directory in the path, when your will have the full path to create react app, I help you.

Example: /usr/bin/uname -a

hi @jefer94 , Im sorry I dont understand. Would you elaborate for me your last comment?

Yes dude.

If you read carefully then you will see after installing Yarn it tells you to add the following thing in your path.

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

~/.yarn/bin is for yarn binaries only.

If you read carefully then you will see after installing Yarn it tells you to add the following thing in your path.

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

~/.yarn/bin is for yarn binaries only.

It works for me! Thank you a lot!

Was this page helpful?
0 / 5 - 0 ratings