06 January, 2019

Manjaro: NPM conflicting versions cannot update






Problem solved npm up and running again.
Problem: Could not update Manjaro after an update in NPM. The message was: "conflicting versions".


Solution: Removed all NPM packages, and then update was possible.

I guess the next step will be to reinstall NPM. It is of course unfortunate, since there is a lot of nodejs related stuff on my system. So I'll hope for the best ...

And here I was right. I cannot install NPM again! However there is a list of conflicting files, that exist in the system, even though NPM was removed. I guess that I have to remove these 11 files manually:

npm: /usr/lib/node_modules/npm/.licensee.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/ci-info/vendors.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/graceful-fs/clone.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/LICENSE findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/README.md findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/chownr.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/package.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/LICENSE findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/README.md findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/package.json findes allerede i filsystemet

Hypothesis: With my experience with NPM I guess that this may cause problems, if these files relate to something else. But ... without further ado I'll remove the problemmakers.

Experiment: remove 11 or so troublemakers.

In order to do so I created a bash script:

The "npm:" was replaced with "rm" in the Mousepad editor, and end of the lines " findes allerede i filsystemet" (danish for = "the file already exists in the file system") was removed in the same way. So the error message was transformed to a simple bash file.

Note the missing shebang (I admit, I'm lazy here but the thing worked for me). You'll have to run this as sudo, since one of the files is protected.

The next step is to reinstall npm.

Result: Success - NPM is now up and running version in 6.5.0. And pacman & co. are able to update the system.