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

Installing gatsby-cli with yarn does not work #8138

Closed
palerdot opened this issue Sep 14, 2018 · 13 comments
Closed

Installing gatsby-cli with yarn does not work #8138

palerdot opened this issue Sep 14, 2018 · 13 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@palerdot
Copy link
Contributor

palerdot commented Sep 14, 2018

yarn global add gatsby-cli

The above command does not work. I have to use npm (npm install -g gatsby-cli) to make it work. Not sure if this issue is consistent across systems.

Summary

Relevant information

Environment (if relevant)

System Details:

System:
OS: Linux 4.4 Ubuntu 16.04.1 LTS (Xenial Xerus)
CPU: x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
Shell: 4.3.46 - /bin/bash
Binaries:
Node: 8.11.4 - ~/.nvm/versions/node/v8.11.4/bin/node
Yarn: 1.9.4 - /usr/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.4/bin/npm
npmGlobalPackages:
gatsby-cli: 1.1.58

File contents (if changed)

gatsby-config.js: N/A
package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A

@stefanprobst
Copy link
Contributor

Have you added yarn's global dir to your PATH? yarn global bin will list the directory, you should export it in your .bashrc, e.g.: export PATH=$PATH:~/.yarn/bin

@kakadiadarpan kakadiadarpan added the type: question or discussion Issue discussing or asking a question about Gatsby label Sep 14, 2018
@kakadiadarpan
Copy link
Contributor

Hi @palerdot, any updates on the suggestions provided by @stefanprobst?

@palerdot
Copy link
Contributor Author

@kakadiadarpan @stefanprobst For now, I have already installed with npm. Maybe, I will update in this thread after trying uninstalling existing and reinstalling with yarn.

@kakadiadarpan
Copy link
Contributor

Sure. For now, we'll be closing this. Please reopen if you still face this issue.

@palerdot
Copy link
Contributor Author

palerdot commented Sep 17, 2018

@stefanprobst @kakadiadarpan adding yarn bin to path works. This should be mentioned somewhere in the docs, just in case.

@muescha
Copy link
Contributor

muescha commented Jan 27, 2019

"The above command does not work" is not enough for search.

Could you add the error message for this command?

@DanielRuf
Copy link
Contributor

adding yarn bin to path works. This should be mentioned somewhere in the docs, just in case.

This is a known issue with Yarn and not directly related to Gatsby.

@portothree
Copy link

"The above command does not work" is not enough for search.

Could you add the error message for this command?

Well, with me what happens is

warning "gatsby-cli > [email protected]" has unmet peer dependency "@types/react@>=16.8.0".
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - gatsby
Done in 3.65s.

@Ri2parna
Copy link

Ri2parna commented Apr 3, 2020

Facing this issue as well!
Here's my output:

arn global v1.22.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - gatsby
Done in 3.43s.

@DanielRuf
Copy link
Contributor

Please check your PATH variable. See also #8138 (comment)

@Ri2parna
Copy link

Ri2parna commented Apr 3, 2020

Forgot to check that, Fixed My issue! Thanks!

@muescha
Copy link
Contributor

muescha commented Apr 3, 2020

@Ri2parna
What was your issue exactly and how you solved it?

@Ri2parna
Copy link

Ri2parna commented Apr 4, 2020

This was the issue I've been facing
The packages seem to get installed but didn't show up when i try to run the terminal :
The terminal gave an output that said : command not found

yarn global v1.22.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - gatsby
Done in 3.43s.

I forgot to add the yarn path to my $PATH, so i found out the directory which is why the installed packages were not showing in my terminal. I found the yarn directory to be added to the path by using yarn global bin and then i added it to the path using the command as stated in
#8138 (comment) and added to my bashrc file ( in my case it was the .zshrc file) and it solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

7 participants