Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to update npm to latest version on Fedora

I've try to run this:
sudo npm install npm@latest -g

to test npm audit, but this command failed, I've got error:
npm ERR! path /usr/lib/node_modules/npm/node_modules/fs-write-stream-atomic
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir
npm ERR! EEXIST: file already exists, mkdir '/usr/lib/node_modules/npm/node_modules/fs-write-stream-atomic'
npm ERR! File exists: /usr/lib/node_modules/npm/node_modules/fs-write-stream-atomic
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-06-04T16_50_00_242Z-debug.log


to restore the state I need to install npm using dnf (I need to remove the npm then /usr/lib/node_modules and install npm again).

if I move the file (it's symlink) then I've got error:
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'fs-write-stream-atomic'

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-06-04T18_09_09_479Z-debug.log


How can I install npm 6 on Fedora?
by

1 Answer

vishaljlf39
I've ended up using nvm

after installation using
nvm install node
nvm use node


and I've got versions node v10.4.0 and npm v6.1.0.

Login / Signup to Answer the Question.