Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After upgrading Node, 'Segmentation fault (core dumped)' error shows up. How can I fix it?

I was trying to upgrade Node by following the instruction from https://tecadmin.net/upgrade-nodejs-via-npm/. I did sudo npm cache clean -f, sudo npm install -g n, and sudo n stable. After the above commands, I stupidly did sudo ln -sf /usr/local/n/versions/node/11.8.0/bin/node /usr/bin/node. After this command, I checked the /usr/local/n/versions/node folder. It had 10.15.3, so I typed sudo ln -sf /usr/local/n/versions/node/10.15.3/bin/node /usr/bin/node.

Right now, node -v gives me 10.15.3. However, npm -version gives me Segmentation fault (core dumped). Other commands like npm update -g also gives me the same error message.

Other posts about the Segmentation fault (core dumped) error don't seem to be directly related to my problem.

How can I fix this?

I am using Ubuntu 19.04.

Thank you.

like image 817
Jeong Kim Avatar asked May 09 '19 00:05

Jeong Kim


People also ask

Does npm -version give Me segmentation fault (core dumped)?

However, npm -version gives me Segmentation fault (core dumped). Other commands like npm update -g also gives me the same error message. Other posts about the Segmentation fault (core dumped) error don't seem to be directly related to my problem.

How to resolve segmentation fault in Ubuntu?

Step 1: Run Ubuntu in startup mode by pressing the Esc key after the restart. Step 3: Run Ubuntu in the recovery mode and you will be listed with many options. So, we have two methods of resolving segmentation fault: CLI and the GUI.

What is the difference between core dumped and segmentation fault?

Segmentation fault is when your system tries to access a page of memory that doesn’t exist. Core dumped means when a part of code tries to perform read and write operation on a read-only or free location.

What causes segmentation fault during the energy minimization?

Hi Tonima! Firstly, what you have posted is not an error message (about the seed). However, the error of segmentation fault during the energy minimization has to do with your starting configuration and how the bond-constraint algorithm is managing it. Also it can happen that you have a box which might be a bit too small.


2 Answers

I faced The same Issue just now, This because of conflicting the npm of node and nodejs

so remove nodejs by below commands

sudo apt-get remove nodejs

this will remove all nodejs related Packages,

after above command you have to run autoremove command just like that

sudo apt autoremove

this will solve the problem,

Now you just have node pacakge in your machine, and NPM (segmentation dumped) error will also resolves.

you can more dig about What is segmentation fault

like image 95
Adarsh Sharma Avatar answered Oct 16 '22 13:10

Adarsh Sharma


Try to run npm rebuild to recompile your dependencies.

like image 40
Samuel Henry Avatar answered Oct 16 '22 13:10

Samuel Henry