Npm update error while updating system

When I was updating with sudo pacman -Syu I got this error:

(411/411) checking keys in keyring                                 [------------------------------------] 100%
(411/411) checking package integrity                               [------------------------------------] 100%
(411/411) loading package files                                    [------------------------------------] 100%
(411/411) 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 fi
lesystem
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js exists in file
system
npm: /usr/lib/node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/license exists in files
ystem
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.

How do I fix this error? Can I just remove npm or something else?

Maybe try this (with sudo, I guess…)

1 Like

This means that you somehow updated it without using pacman earlier. That is using manually copy pasting files/ modules or using npm to update npm.

You have 2 options. Either overwrite or ignore. Both of the options are clear by name, I suppose.

You should refer Archwiki on what effect will they have and how to implement them.

https://wiki.archlinux.org/title/pacman

4 Likes