5 ms·
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 th
by clux 10y ago
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..
- dima55 10y agoThey absolutely should not be wrapping npm. npm is attempting to do a job that package managers should be doing to begin with
- j3097736 10y agoReal 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.
- int_19h 10y agoThe 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.
- subway 10y agoTo 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"
- geofft 10y agoThe 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?
- Spivak 10y agoIt 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/PKGBUILD?h=packages/grunt-cli https://git.archlinux.org/svntogit/community.git/tree/trunk/...