Erreur de segmentation (core dumped) - npm

please
how can i resolve this error on ubuntu?
Erreur de segmentation (core dumped)
after run
$ sudo npm i -g npm
also after run
$ sudo npm install -g #vue/cli-init
I tried the instructions described in this link https://askubuntu.com/questions/690565/how-to-resolve-segmentation-fault-core-dumped without results

I have the same problem and solved it.(my OS is ubuntu 19.4)
the reason that this problem happens, is you installed nodejs and npm separately.
so At first, you should remove nodejs and npm.
sudo apt --auto-remove purge npm
sudo apt --auto-remove purge nodejs
and then install just nodejs
sudo apt-get install nodejs
At last, do following commands for checking nodejs and npm
node -v
npm -v

Related

EACCES: permission denied, open '/Users/stefma/.config/truffle/config.json' after installing Truffle

I tried literally all there is so far and I still can't run truffle macOS 11.6.
that's what I tried after of course first installing it with the command npm install -g truffle:
Downloading command line tools for Xcode and then installing with
sudo npm install -g truffle
sudo npm install --unsafe-perm=true --allow-root truffle
sudo chown myUsername:myUsername -R ~/.config
installing npm and node with nvm all over.
I'd be really grateful for any help
This should work kindly check [YourMacOSUserName] in fir place you MacOSUserName in it and please must rate my effort will be here for any further query.
sudo rm -rf /Users/[YourMacOSUserName]/Library/Preferences/netlify/
npm install -g netlify-cli
sudo ntl login

How to upgrade npm version

I had npm version 3.5.2 installed and then I removed it by
sudo apt-get remove npm
And then I tried installing again by
sudo apt install npm
but still, the version is 3.5.2
Sounds like repositories have an old version.
If you are using ubuntu try:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Or for node 10:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
If you already have npm installed, you can use it to update itself. The command for that would be npm i -g npm.

Why I can't get NPM upgraded?

Here is how I install NPM on a Linux Mint 19.
sudo apt install nodejs
sudo apt install npm
The NPM version I get is 3.5.2, which is not the current version. To upgrade, I try the following commands.
sudo npm install latest-version
which has a few warning messages such as "not such file or directory, open '/home/me/package.json'"
and
sudo mpn install npm#latest -g
which runs without any warning or error messages.
The command
npm -v
still yields 3.5.2.
What is missing?
Also, the reason of using sudo in those upgrade commands is to work around some access permission.
try running:
which npm
and
sudo which npm
I suspect by running sudo apt-get ... you installed npm for your root user as opposed to your current user.
Try this command: npm install -g npm#latest or npm install -g npm#next
You can update NPM with: npm install -g npm.
See this Q&A for more variations that might occur/needed.

npm 3.5.3 not working at all after upgrade

After I upgraded npm to 3.5.3 with
sudo npm install npm -g
on my Linux Mint 17.2 it doesn't work anymore. All the commands return to prompt without any message.
Tried:
sudo npm install -g yo
npm version
According to this and this I had to
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
hash -r #using bash
node --version # v0.10.25
!! WORK FOR ME !!
sudo rm -rf /usr/local/lib/node_modules
At this stage you will see that npm will not work, but sudo npm is working!
Now you can upgrade normally the npm:
sudo npm install -g npm

Could not install appium using ' npm install -g appium ' command

I have installed node on mavericks using 'brew install node'. Node is installed. But npm version is not shown.
$ node -v
v0.10.26
$ npm -v
-bash: npm: command not found
$ npm install -g appium
-bash: npm: command not found
Please help.
Please try re installing node from the installer package available at http://nodejs.org/
If does not work
try running sudo chmod 777 /usr/local/lib/ from Terminal and reinstall node.js