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

[FR] Install peerdeps from local package #62

Closed
kiprasmel opened this issue Dec 19, 2019 · 7 comments
Closed

[FR] Install peerdeps from local package #62

kiprasmel opened this issue Dec 19, 2019 · 7 comments

Comments

@kiprasmel
Copy link

kiprasmel commented Dec 19, 2019

Don't know if this isn't already possible, but I'd like to be able to install peerdeps globally from a local package.

I have a local package (eslint-config-sarpik) which I have installed globally (not via linking (should I just use linking?)).

Sometimes I add some peerDependencies & I'd like to be able to install them myself globally prior to publishing.

Being able to do something like npx install-peerdeps --global --yarn ./ would be awesome.

See also #51 for locally linked packages.

@ljharb
Copy link
Collaborator

ljharb commented Dec 19, 2019

No eslint things should be installed globally; eslint v6 forces local installs more aggressively anyways.

@ljharb
Copy link
Collaborator

ljharb commented Dec 19, 2019

Global things aren’t requireable, so theycant satisfy peer dep requirements anyways.

@kiprasmel
Copy link
Author

kiprasmel commented Dec 19, 2019

No eslint things should be installed globally; eslint v6 forces local installs more aggressively anyways.

Yeah I've tried to get everything working with eslint 6.x but wasted wayyy too much time and it didn't. Went back to 5.x and it's awesome now (both prettier, eslint & typescript work together) 🚀

Global things aren’t requireable, so they_cant_ satisfy peer dep requirements anyways.

Don't understand this, could you elaborate?

@ljharb
Copy link
Collaborator

ljharb commented Dec 19, 2019

Yes. You can’t require() global packages, only run them on the command line. Peer deps are for things your package requires, in its code. Global packages this only make sense when they have no peer deps, which aces out any eslint things.

@kiprasmel
Copy link
Author

I mean installing the peerDeps before publishing lets me test eslint out from the command line to make sure it's working fine, so the globally installed peerDeps do make a difference (I suppose?).

@ljharb
Copy link
Collaborator

ljharb commented Dec 19, 2019

I’m not sure what you mean. If you want to test a shared config before publishing, you’d npm link it, and each of its peer deps, into another project (or, install it from git in the other project).

@kiprasmel
Copy link
Author

kiprasmel commented Dec 19, 2019

I'm just trying to test a shared config myself before publishing to make sure it works.

Doesn't matter though - I figured I'll just use yarn link.
Thank you for your time & help:)

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

2 participants