[aur-general] PSA: nodejs projects in AUR - npm install --user root

Damjan Georgievski gdamjan at gmail.com
Wed Apr 14 11:01:47 UTC 2021


There are a lot of packages in AUR that use something like:

    npm install -g --user root --cache "${srcdir}/npm-cache" --prefix
"$pkgdir/usr" "$srcdir/$_npmname-$pkgver.tgz"

to install and package a nodejs project. I guess at some point in time
`--user root` worked for NPM but nowadays, npm behaves like this:
1) it silently ignores the `--user` option
2) installs the NPM package root (before installing the wanted .tgz)
    https://www.npmjs.com/package/root

I guess `--user root` worked in some version of NPM but at some point
npm decided to remove the option and not error on its use (what can I
say).

So, the recommendation is to remove all uses of `--user root` in PKGBUILD.

ps.
can someone run a grep -r -- "--user root" on the whole of AUR?

-- 
damjan


More information about the aur-general mailing list