Botched npm Update Crashes Linux Systems, Forces Users to Reinstall (bleepingcomputer.com)
Catalin Cimpanu, reporting for BleepingComputer: A bug in npm (Node Package Manager), the most widely used JavaScript package manager, will change ownership of crucial Linux system folders, such as /etc, /usr, /boot. Changing ownership of these files either crashes the system, various local apps, or prevents the system from booting, according to reports from users who installed npm v5.7.0. -- the buggy npm update. Users who installed this update -- mostly developers and software engineers -- will likely have to reinstall their system from scratch or restore from a previous system image.
A shitscript package manager that does a chmod of /etc and /boot? This thing had to have been written by that Poettering asshole.
Only the State obtains its revenue by coercion. - Murray Rothbard
If it is a file permission issue... boot from install disk into rescue mode... chmod and reboot. I don't get it.
I remain of the opinion that none of those "language specifically package managers" have no place on Linux systems. They should use the operating systems package managers and tools.
Ahhh...the great dumpster continuum. Many a free computer will be found there. -- sowth (748135)
"Well, it seemed like a good idea at the time. But looking back, I can see it was a bad idea giving guns to monkeys."
A dingo ate my sig...
1. There is no reason to run a language-specific packager as root, whether npm, pip, composer, maven, etc. Either the package manager makes packages available to the user in $HOME, or there exists some kind of virtual environment tool. Use them.
2. Why is NPM chowning anything?
3. Read the thread, the attitudes there are unfortunate to say the least. A new version of NPM is provided when using NPM to upgrade itself without any arguments, and it grabs a "pre-release" version without warning? The version number is 5.7.0, not 5.7.0-beta or 5.7.0-rc1 or whatever. The NPM people violated semver. So there was no obvious way to know this is not an official release.
I'm god, but it's a bit of a drag really...
What is not mentioned in the summary is that the bug only shows up when using sudo.
Sudo is a nightmare, both technically and psychologically (strangely, it's seems easier to run 'sudo npm' or 'sudo fuck_me' than running the same commands when logged in as root).
It makes me laugh any time when I try to build some shitty program (inside a vm, of course), and more often than not, it tries to run 'sudo' from the install rule and trash over my system by writing and overwriting files inside /usr and /etc, and ignoring any PREFIX option, despite that convention being almost 40 years old.
I really don't understand the appeal of 'sudo' -- what's the problem with ssh root@localhost with public key authentication?
NAME
mtree -- map a directory hierarchy
SYNOPSIS
mtree [-LPUcdeinqruxw] [-f spec] [-f spec] [-K keywords] [-k keywords]
[-p path] [-s seed] [-X exclude-list]
DESCRIPTION
The mtree utility compares the file hierarchy rooted in the current
directory against a specification read from the standard input. Mes-
sages are written to the standard output for any files whose character-
istics do not match the specifications, or which are missing from
either the file hierarchy or the specification.
bash$
Phil
This is why I always reject anything that has requirements that I install the latest version of everything and use a language specific package manager to manage dependencies. Javascript packages seem the worst for the "bleeding edge" requirement, but Java, PHP, Python, Ruby and even Perl have long had issues with requiring the language specific package manager to be used.
If my distro maintainers have not packaged it and tested to the level that the rest of the OS gets tested, then it has no place on my server.