Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

No need for install -g #941

Open
Pomax opened this issue Dec 4, 2018 · 2 comments
Open

No need for install -g #941

Pomax opened this issue Dec 4, 2018 · 2 comments

Comments

@Pomax
Copy link

Pomax commented Dec 4, 2018

Due to how npm works, you don't need to install gemini and selenium with -g, you can keep everything local to your project.

Just install with --save-dev, and then gemini etc. can be called in npm scripts without any additional work. If you also need to run them in other scripts like make or the like (not recommended of course, npm scripts are cross-platform, make etc. are not) there is the npx command, which is the only npm dependency (possibly alongside nvm) that you should need to install globally.

@sipayRT
Copy link
Member

sipayRT commented Dec 5, 2018

but you don't need to install your selenium-standalone in each project - this is a common util for test running. yes, you can install gemini locally, but not selenium-standalone - is't uncomfortably in development

@Pomax
Copy link
Author

Pomax commented Dec 5, 2018

Maybe, but there are also folks like me, who have about 100+ git projects cloned and installed, and literally none of them use selenium. Even though it's "a widely used tool", it's not a "universally used tool": you're going to find loads of folks who've never used it, and have no desire to install something globally that's only used for one or even a few projects =)

Also, because of how npm works, local dependency tracking is preferable to global dependency tracking: global dependencies cannot be version pegged, which means package-lock.json is still going to force that dependency into the local tree instead, to prevent version conflicts for projects that rely on a specific version of selenium in order not to run into "oh the new version just "pulled an event-stream" and has a bitcoin mining patch in it".

Unless it's npm itself, or tools to use npm managed packages, the modern approach is to have it all local using --save-dev, and have npm manage the filetree. It's really good at that by now.

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

No branches or pull requests

2 participants