2

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?

0

2 Answers 2

2

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.

0

Also, you might want to consider asdf. It's based on a plug-in system and installs ‒ sort of.

[gorre@uplink ~]$ asdf plugin-add nodejs
[gorre@uplink ~]$ bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
[gorre@uplink ~]$ asdf install nodejs <version_here>
[gorre@uplink ~]$ asdf global nodejs <version_here>

NOTE: All of that, provided you installed asdf previously.

You can install different versions and refer to them by specifying local in the particular directory that you would like. The basics is that it will create .tool-versions file that refers to that version, overwriting the other settings.

The bonus here is that asdf not only supports Node.js, but many other languages/platforms/toolkits, as well as maintaining, to some extent, the same capabilities of nvm.

1
  • I don't think I will use this since I already have nvm working but maybe it will help someone else.
    – jcubic
    Jun 10, 2018 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.