News for hackers. Stuff that matters.
Re:Umask setting is ignored by npm for some directories by xiwenc on Wednesday October 26, 2016 @12:38PM (#12797962)
Yesterday after I did `pacman -Syu` on my Arch Linux I noticed the following:

( 95/121) installing grunt-cli [########################################] 100%

warning: directory permissions differ on /usr/bin/

filesystem: 755 package: 777

warning: directory permissions differ on /usr/lib/node_modules/

filesystem: 755 package: 777

:facepalm:

Re:Umask setting is ignored by npm for some directories by clux on Wednesday October 26, 2016 @12:45PM (#12798064)
Managing node with package managers feels like a a bit of a fools errand at the moment. They are going to be wrapping npm somehow, but when npm can't even do things right..
Re:Umask setting is ignored by npm for some directories by subway on Wednesday October 26, 2016 @01:52PM (#12798752)
To be fair, that aptly describe being a package maintainer in general -- you spend all day adding workaround patches so build systems stop doing things the "wrong way".

edit: Where "wrong way" is defined as "differently from the target distro's best practices"

Re:Umask setting is ignored by npm for some directories by dima55 on Wednesday October 26, 2016 @01:49PM (#12798725)
They absolutely should not be wrapping npm. npm is attempting to do a job that package managers should be doing to begin with
Re:Umask setting is ignored by npm for some directories by int_19h on Wednesday October 26, 2016 @10:30PM (#12802492)
The problem is that there is no single package manager that covers every platform. If you are writing an inherently portable library in node.js, as an author, are you supposed to also provide packages for RPM, dpkg, pacman, brew etc? Or do you expect distros to package every tiny thing?

So in practice there is a niche that npm covers, that wouldn't be filled if we removed it.

On the question of whether the system package manager should wrap npm - the reason why you want to do so is because it lets npm dependency resolution work regardless of how packages are installed. If the system package manager just does its own thing, then next time you do need to npm install a package (because it's a relatively obscure package that's not in your distro), you don't want it to install copies (or worse, yet overwrite) all the dependencies that you've already installed by other means.

Re:Umask setting is ignored by npm for some directories by j3097736 on Wednesday October 26, 2016 @05:25PM (#12800743)
Real package managers should be left to manage system packages, where packages are often supported for a few years.

Package managers for scripting languages and similar should be left to manage user-wide packages, or virtualenv-wide for webapps.

Re:Umask setting is ignored by npm for some directories by geofft on Wednesday October 26, 2016 @03:12PM (#12799491)
The usual way package managers do this is, at packaging time, to use the native build tool to install the software rooted in a temporary directory, then fix up those files as needed (including fixing permissions and ownership) and copy them into a tarball. Does pacman not do that?
Re:Umask setting is ignored by npm for some directories by Spivak on Wednesday October 26, 2016 @03:49PM (#12799823)
It does [1]:

  package() {

    npm install -g --user root --prefix "$pkgdir"/usr "$srcdir"/$pkgname-$pkgver.tgz

    rm -r "$pkgdir"/usr/etc

    mkdir -p "$pkgdir/usr/share/licenses/$pkgname"

    ln -s "../../../lib/node_modules/$pkgname/LICENSE-MIT" "$pkgdir/usr/share/licenses/$pkgname/"

  }
[1] https://git.archlinux.org/svntogit/community.git/tree/trunk/...