3 ms·
Wouldn't it be easier for the end user if you used pip/PyPi? Essentially all Linux distros include Python, but there are very few that ship with Node.js install
by semi-extrinsic 11y ago
Wouldn't it be easier for the end user if you used pip/PyPi? Essentially all Linux distros include Python, but there are very few that ship with Node.js installed by default.
- LyndsySimon 11y agoI can only speak for myself, but my systems all prohibit installation of packages into the system Python namespace by default.
- tomjakubowski 11y agoYeah, I try to avoid "sudo pip install" for CLI utilities if I can (and discourage its use to others). I put ~/.local/bin on my PATH (nonstandard XDG -like convention) and use "pip install --user" instead. I've seen too many Python environments hosed by folks who aren't Python experts to keep suggesting that "sudo pip install <CLI tool>" is a thing most users should be doing.
- LyndsySimon 11y agoI use ~/.bin/ for what sounds like the same purpose. I'm not sure I'd call that a convention - it's just what made sense to me - but it does ease issues requiring that userspace executables be on my $PATH.
- semi-extrinsic 11y agoSo you need to be root to write to /usr/local/bin/. How does NPM magically solve this? (pip has the `--user` flag to install for just the current user, as tom points out.)
- LyndsySimon 11y agoIt doesn't solve it, and I don't think I claimed it did - I simply inferred that I don't think installing it into the system (or user) Python is a good idea either.
- semi-extrinsic 11y agoAh, I see, I misunderstood your comment. But I think pip gives you better options than NPM, which installs into either /usr/local/(...) or the current directory. The latter sounds like a mess waiting to happen.
- goldbrick 11y agoAnd most of distros don't come with pip, so we're back at square one.
- semi-extrinsic 11y agoPython >= 2.7.9 or >= 3.4 ships with pip installed by default. Those versions are more than a year old now. What are you running, Slackware or something?
- goldbrick 11y agoI would double check that if I was you. My Debian Jessie machine (from the official Vagrant box) reports Python 2.7.9. No pip.
- semi-extrinsic 11y agoStrange. This is from the official Python docs: "pip is the preferred installer program. Starting with Python 2.7.9, it is included by default with the Python binary installers." https://docs.python.org/2.7/installing/ https://docs.python.org/2.7/installing/
- goldbrick 11y agoMy thought would be that "binary installers" as such are considered distinct from distro-managed packages.
- txutxu 11y agoI've many Debian servers without nodejs _and_ without python. It requires conscious work as any other dependency, but it's possible (and convenient, if you don't depend on them). So more than probably, I'll not install npm, to test a bash wrapper to a perl script, that does something that git itself can do without external dependencies. But obviously, different persons have different concepts of the K.I.S.S. principle. Being a perl script... why the author didn't use CPAN? it's available in all vanilla installs of Debian, CentOS, Ubuntu, RedHat, etc...