I just tried to update my Manjaro KDE, but the last few lines of the process is as follows:
error: failed to commit transaction (conflicting files)
npm: /usr/lib/node_modules/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff exists in filesystem
npm: /usr/lib/node_modules/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 exists in filesystem
npm: /usr/lib/node_modules/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff exists in filesystem
npm: /usr/lib/node_modules/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 exists in filesystem
npm: /usr/lib/node_modules/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfecg.woff2 exists in filesystem
npm: /usr/lib/node_modules/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfedA.woff exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/string-width/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/string-width/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/string-width/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/string-width/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/cliui/node_modules/strip-ansi/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/LICENSE-MIT.txt exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/README.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/es2015/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/es2015/text.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/emoji-regex/text.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/get-caller-file/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/get-caller-file/index.js.map exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/require-main-filename/CHANGELOG.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs-parser/node_modules/camelcase/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs-parser/node_modules/camelcase/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs-parser/node_modules/camelcase/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/lib/completion-templates.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/lib/is-promise.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/lib/middleware.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/ansi-regex/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/ansi-regex/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/ansi-regex/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/ansi-regex/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/find-up/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/find-up/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/find-up/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/find-up/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/locate-path/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/locate-path/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/locate-path/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/locate-path/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-limit/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-limit/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-limit/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-limit/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-limit/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-locate/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-locate/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-locate/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-locate/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-try/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-try/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-try/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-try/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/p-try/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/string-width/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/string-width/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/string-width/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/string-width/readme.md exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/strip-ansi/index.js exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/strip-ansi/license exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/strip-ansi/package.json exists in filesystem
npm: /usr/lib/node_modules/npm/node_modules/yargs/node_modules/strip-ansi/readme.md exists in filesystem
Errors occurred, no packages were upgraded.
To understand why @cscs has accessed the situation correct one must understand the package manager within the realms of an ArchLinux based system.
The package manager - pacman and the supporting library libalpm - keeps track of files which exists as a part of the system.
When pacman encounters files - in system locations - which is not registered within the pacman registry - the package manager refuses to commit the transaction.
This is a very reasonable behavior and the only way to avoid such situations is to avoid using arbitrary applications as root to install files to system locations.
This includes various common development tools like npm, pip, bower, grunt and probably additional tools I haven’t thought of.
Always avoid commands like sudo npm or sudo pip as it will - sooner or later create issues like this.
I have copied one the FAQs from the archived forum - read on below
Just by reviewing my history, I think I’ve found the culprit at 337 (I don’t remember why I used sudo there, but obviously I tried to use npm without it):
327 git clone https://github.com/Physiix/topsi-project-manager
328 npm install vue
329 cd topsi-project-manager/
330 npm install vue
331 cd ..
332 ll
333 cat package-lock.json
334 rm -rf package-lock.json
335 cd -
336 npm install -g npm
337 sudo npm install -g npm
338 npm install vuetify
339 npm install quill
340 npm install sortable
341 yarn
342 yarn install
343 yarn run dev
344 yarn build
345 kate src/components/dialogs/content/EditNoteDialog.vue &
346 yarn build
347 yarn build
348 yarn run dev
That’s the only occurrence of sudo npm in my history.
$ sudo pacman -Syu --overwrite "/usr/lib/node_modules/npm/*"
[sudo] password for jazz:
:: Synchronizing 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...
there is nothing to do
Thanks @freggel.doe , this resolved my issue. Special thanks to @linux-aarhus, since I understand how the problem occurred and how to avoid similar issues in the future. Hope this thread will be a good asset for similar stories in the future.