Conflicts with npm files

I got conflicts with npm files
This is the output (in brazilian portuguese):

erro: falha ao efetuar a transação (arquivos conflitantes)
npm: /usr/lib/node_modules/npm/lib/package-url-cmd.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/lib/utils/format-search-stream.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/LICENSE existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/examples/normal-usage.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/examples/safe-string.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/index.d.ts existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/colors.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/custom/trap.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/custom/zalgo.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/extendStringPrototype.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/maps/america.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/maps/rainbow.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/maps/random.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/maps/zebra.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/styles.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/system/has-flag.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/lib/system/supports-colors.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/package.json existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/safe.d.ts existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/safe.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@colors/colors/themes/generic-logging.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/override-resolves.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@npmcli/disparity-colors/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@npmcli/move-file/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/cli-table3/src/debug.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/cmd-shim/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/ignore-walk/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/ini/lib/ini.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/minimatch/lib/path.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/npm-install-checks/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/read-cmd-shim/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/brace-expansion/LICENSE existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/brace-expansion/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/brace-expansion/package.json existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/glob/LICENSE existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/glob/common.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/glob/glob.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/glob/package.json existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/glob/sync.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/minimatch/LICENSE existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/minimatch/minimatch.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/rimraf/node_modules/minimatch/package.json existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/ssri/lib/index.js existe no sistema de arquivos
npm: /usr/lib/node_modules/npm/node_modules/treeverse/lib/index.js existe no sistema de arquivos
Ocorreram erros e, portanto, nenhum pacote foi atualizado.

That’s what happens when you don’t care to read how to do stuff and just do it.

Don’t use sudo with anything but pacman!

Remove packages you installed with npm.

I DO read stuff while administering my system, so better you don’t just false claim something about someone else as if you know better.

Anyways, i’m gonna take a look into that. Probably some mistake i made while i was doing a university project with a Linux begginner friend on university in a lot of rush, or some crappy made by a AUR package i missed to review on that time.

Marking this topic as ignore as there seems to be growing some toxic and unrespectful behaviour

1 Like

I agree. People being too lazy and too important to do some basic searches and work themselves. It’s just easier to throw errors in a post and let others do the work for you, isn’t it?

Here you go: manjaro npm exists in filesystem - Google Suche

3 Likes

That’s a issue reporting topic, people report their issues there, and most work on resolving them by themselves and speak how they fixed it on there later, even if that was their fault. Because other people may also suffer this issue too, so instead of acting as toxic and arrogant, you should help giving hints to other people that might read it soon.

Btw, i forgot to post how to solve this issue, so let’s just forget that stupid drama and here it goes:

I suggest you check your global root prefix first, you can use ‘sudo npm prefix -g’ to check where did it extracted all that modules accidentally in your system. Usually, it’s located in /usr

So, i’ll use $NPMPREFIX variable just to tell that’s your prefix. To change that auomatically, use:
# export NPMPREFIX="$(npm prefix -g)"

Now, remove the node_modules on this prefix

# rm -rf $NPMPREFIX/bin/node_modules

You may also need to remove lib/node_modules:

# rm -rf $NPMPREFIX/lib/node_modules

How about you read 100 posts before you with exact same problem? Looks like you break your own theory right here.

And I told you what the solution is and even gave you search results link with more solutions.
Anyway, congratulations on finding the solution. :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.