You are not logged in.
Hello!
I am trying to update npm (as part of a full system upgrade), but it is coming up with some errors:
:: Synchronising package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
Packages (1) npm-8.1.4-1
Total Installed Size: 5.91 MiB
Net Upgrade Size: 0.01 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [---------------------------------------------------------------------------------------] 100%
(1/1) checking package integrity [---------------------------------------------------------------------------------------] 100%
(1/1) loading package files [---------------------------------------------------------------------------------------] 100%
(1/1) checking for file conflicts [---------------------------------------------------------------------------------------] 100%
error: failed to commit transaction (conflicting files)
npm: /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/LICENSE.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/LICENSE.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/base-theme.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/demo.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/error.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/has-color.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/plumbing.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/process.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/progress-bar.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/render-template.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/set-immediate.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/set-interval.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/spin.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/template-item.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/theme-set.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/themes.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/lib/wide-truncate.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/ansi-regex/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/ansi-regex/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/ansi-regex/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/ansi-regex/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/string-width/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/string-width/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/string-width/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/string-width/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/strip-ansi/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/strip-ansi/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/strip-ansi/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/strip-ansi/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/npmlog/LICENSE.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/npmlog/lib/log.js exists in filesystem
Errors occurred, no packages were upgraded.
Is there a fix for this?
Last edited by dr_carlos (2021-12-14 10:50:00)
Offline
You should not install npm packages system wide manually otherwise issues like these can happen. Use npm to uninstall the gauge module or force overwrite these with a
pacman --overwrite "*" -S npm
Offline
Interestingly enough, I've had the exact same issue today after moving the $HOME/.npm directory to xdg data home and creating /usr/etc/npmrc. Maybe that's the reason of this issue. Btw, just overwriting npm with pacman helps, thank you v1del.
Offline
You should not install npm packages system wide manually otherwise issues like these can happen. Use npm to uninstall the gauge module or force overwrite these with a
pacman --overwrite "*" -S npm
Okay, thanks. I wasn't aware.
Is there any way of installing these packages user-wide instead of system wide?
Offline
Don't run npm as root and it will install them into the current dir, otherwise see: https://wiki.archlinux.org/title/Node.j … tallations
Offline
Don't run npm as root and it will install them into the current dir, otherwise see: https://wiki.archlinux.org/title/Node.j … tallations
Thanks!
Offline
The way you update npm is by using npm like "npm i -g npm@9.9.9"
I just added npm to the ignore list in "/etc/pacman.conf"
Offline