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

get rid of preferGlobal in package.json #270

Closed
andrewrk opened this issue Oct 28, 2014 · 1 comment · Fixed by #280
Closed

get rid of preferGlobal in package.json #270

andrewrk opened this issue Oct 28, 2014 · 1 comment · Fixed by #280

Comments

@andrewrk
Copy link
Contributor

It's always better to install modules and version lock modules on a per-project basis. istanbul is no exception.

This project over here might have scripts to run tests and coverage that depend on istanbul version xyz, and this project over there might depend on istanbul version abc. This is what devDependencies are for. The point of package.json is so that you can run npm install and have all the dependencies and devDependencies installed. You don't want to also have to include instructions in the README that say, oh yeah, after you do npm install, you also have to manually install istanbul.

You can access istanbul via /node_modules/.bin/istanbul once you install it local to the project. Look how real world projects use istanbul. This is an example of a correctly organized project, and it has to deal with the preferGlobal warning.

There is no reason for preferGlobal, and in fact it gives new Node.js developers bad habits. Please remove it from your package.json.

@gotwarlost
Copy link
Owner

Agreed on your points. Easier to fix if this is a pull request :)

andrewrk added a commit to andrewrk/istanbul that referenced this issue Dec 3, 2014
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.

2 participants