cjb / GitTorrent

A decentralization of GitHub using BitTorrent and Bitcoin
MIT License
4.75k stars 264 forks source link

Readme: Install npm package globally #30

Closed bencevans closed 9 years ago

cjb commented 9 years ago

@bencevans Thanks! Perhaps this should be sudo npm install -g gittorrent?

bencevans commented 9 years ago

In README's I'd suggest longform options (--global rather than -g) as for users that arn't used to npm etc might get a better idea.

Ideally sudo shouldn't be used when installing modules either. Stick them in userland! :D

On Mon, Jun 1, 2015 at 3:55 PM, Chris Ball notifications@github.com wrote:

@bencevans Thanks! Perhaps this should be sudo npm install -g gittorrent?

— Reply to this email directly or view it on GitHub.

cjb commented 9 years ago

Ah, that's fair. But won't it just fail for everyone by trying to write to /usr/local, when you use --global but not sudo?

ralphtheninja commented 9 years ago

@cjb It depends on how you have setup your system. Personally I have setup so my current user owns /usr/local

cjb commented 9 years ago

But the point of the README is to explain how to install npm modules to people who don't already know, and those people are very likely not to have set up their system to make --global work without sudo.

It seems like it would make more sense to include sudo in the instructions, and then people who've done as @ralphtheninja did will know that it's safe for them to remove the sudo.

ralphtheninja commented 9 years ago

Or perhaps write something like

$ [sudo] npm i -g gittorrent

I'd say the convention is to just write npm i -g xyz to inform the user that it's a global install and leave up the user to decide if he/she needs to do sudo or not.

swizzard commented 9 years ago

Why not

add the --global flag to install globally (may require superuser privileges)
ralphtheninja commented 9 years ago

If this is only meant as a cli tool it should always be installed globally imo.

@cjb Or is this meant to be used as a dependency as well?

cjb commented 9 years ago

@bencevans Thanks for the patch! I'll merge this, add a sudo, and add a note explaining that you can avoid using sudo if you get the binaries into your $PATH.

ralphtheninja commented 9 years ago

:+1:

bencevans commented 9 years ago

Sweet! On 2 Jun 2015 17:32, "Chris Ball" notifications@github.com wrote:

@bencevans https://github.com/bencevans Thanks for the patch! I'll merge this, add a sudo, and add a note explaining that you can avoid using sudo if you get the binaries into your $PATH.

— Reply to this email directly or view it on GitHub https://github.com/cjb/GitTorrent/pull/30#issuecomment-108007475.