npm 3.5.3 not working at all after upgrade - npm

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

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.

Erreur de segmentation (core dumped)

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

How to remove ripple emulator using npm

Have problem with uninstaling ripple emulator at Debian Jessie.
Was instaled by command
sudo npm install -g ripple-emulator
But when I try to uninstall using command
sudo npm rm ripple-emulator
It gives warning
npm WARN uninstall not installed in /home/user/node_modules: "ripple-emulator"
I have change location to /usr/share/npm/node_modules/ but there no folder with ripple emulator
If installed with the -g flag you need to pass that in when uninstalling as well. So the following should work:
sudo npm rm -g ripple-emulator