I am having problems installing underscore with npm - node.js

I have the NodeJS LTS v14.15.0 installed on my Windows 10. I have npm 5.5.1. I am trying to install Underscore via the command prompt npm i underscore. I keep getting the message "npm does not support Node.js v14.15.0".
I have tried to reinstall NodeJS, expecting to have the newest version of npm installed along with it, but I keep getting 5.5.1. I have tried running npm install -g npm, but keep getting the same error "npm does not support Node.js v14.15.0". Not sure what else to do. I am new to NodeJS. Can anyone help with this?

Try to uninstall npm
npm uninstall -g npm
and then reinstall NodeJs.

Related

npm package getting installed but not working

when I am using command npm install -g lerna it gets executed with no error but after that using command
lerna --version gives output "lerna:command not found".
Possible solution
maybe if somehow I manage it to install in usr/local/lib/node_modules it should work cause other npm packages installed here are working fine but its getting installed in /home/surajkulriya/.npm-global/lib/node_modules.
OS: ubuntu 18.04
which npm:/usr/local/bin/npm
which node:/usr/local/bin/node
which nodejs:/usr/bin/nodejs
Finally after too much effort I sorted out the issue. I removed node nodejs and npm completely and reinstalled them again and used command
npm i -g npm
to fix the broken dependecies.I reinstalled lerna and it worked.

Installing Node.js latest version

I was having trouble in updating my npm. I updated my node from v6 to v10. And was wondering what version of npm is installed with the version of v10? or does it remain same ? because in my case it was still showing same old version of npm which is 3.3.12, could not able to update it to 6.5.0. there was some constant error coming which was really annoying every time. So i tried to uninstall node and install it again and again. But it is not working. for people to know i am using windows 7.
The error that i get when i try to update npm using command :
npm install --global --production npm-windows-upgrade
Error: Cannot find module 'internal/util/types'
and when i run : npm-windows-upgrade --npm-version latest ,
i get the error to reinstall node as there was error in installing npm upgrade. Please suggest me what to do
Update node version:
Use n module from npm in order to upgrade node
sudo npm cache clean -f sudo npm install -g n sudo n stable
To upgrade to latest version (and not current stable) version, you can use
sudo n latest
You will be found latest version for both npm and node
How about npm rebuild it? Hopefully, it would help you. If not working, reinstalling node and clearing npm cache could be fixed probably.

How to properly upgrade npm on debian when installed with apt

I have issue with jessie and npm.
I have installed package nodejs with sudo apt-get install nodejs, so it installed npm automatically.
I then want to install latest of npm using npm i -g npm#latest, which work fine except the apt npm version is conflicting.
I want to remove the conflicting apt installed version, or to know the official way to update npm, if installed from apt.
I am only able to update node using npm i -g n then n stable but it is impossible for me to upgrade npm
npm is distributed with Node.js- which means that when you download Node.js, you automatically get npm installed on your computer.
A quote from The npm Blog
The best way to install npm is to install node using the node.js installer. npm is installed as part of node.
It’s over at nodejs.org. It will give you a recent, working version of npm with all the paths in the expected places. This is the version that npm Inc and the Node.js project both support.
Once you’ve installed Node.js, you can make sure you’ve got the very most recent version of npm using npm itself by running this:
npm install npm -g
If you have issues, do not use sudo, read in documentation fixing npm permissions carefully and configure npm properly.

reinstalled npm - now npm works only with sudo (osx high sierra)

I was unable to install electron in my system (was getting postinstall error). So I thought let me uninstall and reinstall node and npm. I tried this gist and couldnt install npm - that erred out. So I went to node js website and downloaded versions: node 8.9.0 & npm 5.6.0. While I now have node and npm back, no npm installation works without a sudo. Funny thing, I get the same electron installation error. I tried fixing the sudo problem using this link but no help. Please advise!
Screenshot of the npm error:
Screenshot of the electron installation error:

angular cli install command showing errors

npm install -g #angular/cli
I am trying to install angular cli on Windows 10, I have already installed npm and node, and have verified their version, they are above then what is required for angular cli to install but when I run install command on the prompt it show error.
i have uninstalled npm and node, then reinstalled them, and tried again to install and it worked :) thanks
first try to see node and npm is installed successfully using following commands on cmd
node -v
for node and it will return the version of node,then
npm -v
then it will return the version of npm after that in windows go to environment variables and see node environmental varible is there. after that
npm cache clean --force
use to clean the cache and go to users/Appdata/roaming and delete all the node modules in npm cache folder and restart your computer and give the following command.
npm install -g #angular/cli

Resources