3 ms·
>Literally every single installation instructions I have seen for node cli tools have said the same thing, install globally. You must not use node very much, t
by wcummings 13y ago
>Literally every single installation instructions I have seen for node cli tools have said the same thing, install globally.
You must not use node very much, then. Generally, IF there are instructions, which there often aren't because its so obvious, it's because the package installs a bin you would want globally available. Most instructions don't exist, or tell you what to put in your package file
- iaskwhy 13y agoThere sure are a lot of results for "npm install -g" in GitHub, some of them are the recommended way to install a module.
- doesnt_know 13y agoYou're right, I'm relatively new to node. This is exactly why I have been reading the manuals of various packages. Apparently, I'm the only that does here. You are just flat out wrong to say that projects don't say to install globally. Just after a super fast search of some well known packages: Express npm install -g express-generator@3 https://www.npmjs.org/package/express https://www.npmjs.org/package/express Mocha $ npm install -g mocha http://visionmedia.github.io/mocha/#installation http://visionmedia.github.io/mocha/#installation node jslint npm install jslint -g https://github.com/reid/node-jslint https://github.com/reid/node-jslint Yeoman npm install -g yo http://yeoman.io/ http://yeoman.io/ Bower npm install -g bower http://bower.io/ http://bower.io/ JSHint $ npm install jshint -g http://www.jshint.com/docs/ http://www.jshint.com/docs/ Grunt npm install -g grunt-cli http://gruntjs.com/getting-started http://gruntjs.com/getting-started
- mateuszf 13y agoI kind of agree, though those are all development tools which shouldn't influence packaged apps.
- wcummings 13y ago>it's because the package installs a bin you would want globally available Everything in that list. You conveniently ignore that the express guide tells you to add express to its package file, express-generator is a separate utility. No one installs libraries globally.
- doesnt_know 13y agoI'm not "conveniently ignoring" it, it's just the distinction is irrelevant. You are running npm as root and installing packages. Even if you completely ignore the security issues (which was my entire argument to begin with that you ignored). "Globally available" in this context really just means "put in your PATH", which can easily be accomplished without giving a bunch of random javascript tools root access to the machine.