npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

NPM Segfaults with the nodejs 10.x+ (nvm)

Hi everyone.

I seem to be encountering a weird bug when trying to use nvm. Here’s the tl; dr summary of my problem:
When I install node 10.x using nvm, it complains of an empty prefix option. Once I follow its instruction, neither node nor npm work. They segfault immediately.

Detailed Description:

I am currently trying to get node v10.x working on my machine. It’s an HP laptop running Fedora 29. However, as soon as it is installed, I see the following error:

$  nvm install lts/dubnium
Downloading and installing node v10.15.0...
Downloading https://nodejs.org/dist/v10.15.0/node-v10.15.0-linux-x64.tar.xz...
############################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v10.15.0` to unset it.

However, if done so, the following happens:

$ nvm use --delete-prefix v10.15.0
> Segmentation fault (core dumped)
$ which node
> ~/.nvm/versions/node/v10.15.0/bin/node
$ which npm
> ~/.nvm/versions/node/v10.15.0/bin/npm
$ node
> Segmentation fault (core dumped)
$ npm
> Segmentation fault (core dumped)

I have managed to get a hold of the relevant log here:

And here is the relevant nvm debug output:

What is curious however is if I invoke the node binary by its absolute path, it works, but I see the same problem with npm. Seg Fault, core dumped. And yes, I do that after adding node’s bin directory to the path.

Things I have already done:

So far, it seems npm might be implicated. This is a major problem for me right now. I need to get back to work. Any help will be appreciated.


Moved to #support because it’s a node issue, though @ljharb might be interested in this.


A number of users on similar OS’s are reporting the same; however, it seems like a node/npm issue unrelated to nvm (since all nvm does is install, and set the PATH).