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


(Ali Sajid Imami) #1

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:

  • Reboots,
  • Uninstall individual node versions and reinstall them
  • Uninstall nvm, reinstall nvm and then install new node 10.15.
  • Upgrading to latest node/npm
  • Check for .npmrc files and remove them.
  • Check for system node. (never had any)
  • run the node deactivate/activate cycle multiple times
  • Try the npm use multiple times. Ostensibly to fix PATH issues

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.


(Kat Marchán) #2

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


(Jordan Harband) #3

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).


(system) #4

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