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

yarn global add installs dependency to current directory #1563

Open
James-Parsons opened this issue Oct 30, 2016 · 2 comments
Open

yarn global add installs dependency to current directory #1563

James-Parsons opened this issue Oct 30, 2016 · 2 comments

Comments

@James-Parsons
Copy link

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

What is the current behavior?
When I attempt to install React Native via yarn global add react-native-cli React Native is installed in the current directory as opposed to globally.

If the current behavior is a bug, please provide the steps to reproduce.

  • Install yarn as described in the docs
  • Add React Native globally via yarn global add react-native-cli
  • react-native init does not work as dependency is installed in the current direcoty of the terminal used to install it.

What is the expected behavior?
React Native should be installed globaly.

Please mention your node.js, yarn and operating system version.
Node: v6.9.1
Yarn: 0.16.1
OS: Lubuntu 16.04 6-bit

@markstos
Copy link
Contributor

markstos commented Feb 3, 2017

@James-Parsons. Did you use sudo or not? What is returned when you run yarn global bin? Do you still get the same behavior with yarn v0.19.1?

I just tried with 0.19.1 and I have a different kind of failure when running as a normal user (no "sudo"). My yarn global bin reports that it's going to attempt to install binaries into /usr/bin, which my user doesn't have permission to write to, so the binaries fail to get install globally or locally.

See #1194 for more discussion of "global" paths for users vs root users.

@OmgImAlexis
Copy link

@James-Parsons are you sure you didn't accidentally run yarn add global react-native-cli instead? If so this is a known issue as yarn accepts both yarn add global <package_name> as well as yarn global add <package_name>.

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

No branches or pull requests

5 participants