You are not logged in.

#1 2021-12-14 03:13:43

dr_carlos
Member
Registered: 2021-12-14
Posts: 7

[Solved] Error Upgrading NPM

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

#2 2021-12-14 08:25:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,740

Re: [Solved] Error Upgrading NPM

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

#3 2021-12-14 09:03:54

Akim
Member
Registered: 2021-08-04
Posts: 42

Re: [Solved] Error Upgrading NPM

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

#4 2021-12-14 09:15:08

dr_carlos
Member
Registered: 2021-12-14
Posts: 7

Re: [Solved] Error Upgrading NPM

V1del wrote:

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

#5 2021-12-14 10:28:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,740

Re: [Solved] Error Upgrading NPM

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

#6 2021-12-14 10:49:38

dr_carlos
Member
Registered: 2021-12-14
Posts: 7

Re: [Solved] Error Upgrading NPM

V1del wrote:

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

#7 2022-04-18 08:51:49

BotDamian
Member
Registered: 2022-04-18
Posts: 2

Re: [Solved] Error Upgrading NPM

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

Board footer

Powered by FluxBB