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

npm is suggested when installed via yarn (global install only) #118

Closed
OmgImAlexis opened this issue Jul 13, 2017 · 5 comments · Fixed by #132
Closed

npm is suggested when installed via yarn (global install only) #118

OmgImAlexis opened this issue Jul 13, 2017 · 5 comments · Fixed by #132

Comments

@OmgImAlexis
Copy link

I have xo installed via yarn not npm which means if I "update" with npm I'll end up with two copies of xo in my $PATH.

➜  SickRage git:(develop) ✗ realpath $(which xo)      
/Users/xo/.config/yarn/global/node_modules/xo/cli.js
   ╭───────────────────────────────────────╮
   │                                       │
   │   Update available 0.17.1 → 0.18.2    │
   │       Run npm i -g xo to update       │
   │                                       │
   ╰───────────────────────────────────────╯
@sindresorhus
Copy link
Member

Yarn users should IMHO know what to do when they see npm install instructions. Same with readmes, almost no projects document Yarn in the install instructions.

@OmgImAlexis
Copy link
Author

Is there any harm in adding a check for it? Just checking if the path to the package contains yarn should be enough to determine if it's installed via yarn.

@SBoudrias
Copy link
Member

@OmgImAlexis That's a good idea. I'm sure a PR is welcomed to fix that.

@LitoMore
Copy link
Contributor

LitoMore commented Jan 3, 2018

const updateNotifier = require('update-notifier');
const pkg = require('chalk/package');

const notifier = updateNotifier({pkg});

notifier.notify();

How to determine whether chalk is installed by npm or yarn?

@OmgImAlexis OmgImAlexis changed the title npm is suggested when installed via yarn npm is suggested when installed via yarn (global install only) Jan 3, 2018
@LitoMore
Copy link
Contributor

LitoMore commented Jan 9, 2018

I will make a pull request to solve the issue.

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

Successfully merging a pull request may close this issue.

4 participants