npm does not support Node.js v12.18.3 - node.js

Can see it's been asked a dozen times but none of the solutions I've found have worked for me so far.
I've installed the latest version of Node.js (12.18.3) on my Windows 10 PC and I'm trying to install a package using npm. When I input npm -v it comes back with 5.6.0, which to me looks out of date - but when I try and install a package or update npm, I get the following error every time:
npm WARN npm npm does not support Node.js v12.18.3
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
I've tried uninstalling Node.js completely, deleting all node_modules folders and restarting my computer after a fresh install, but it's the same thing each time. I've also tried using npm install -g npm and npm install npm#latest -g but again, I get the same error.
Any solutions here?

I found the work-around !
First you need to open your cmd line, and use " npm install -g npm#latest "
you'll get the error like this
C:\Users\KimeruLenovo>npm install -g npm#latest
npm WARN npm npm does not support Node.js v14.7.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function npm ERR! A complete log of this
run can be found in: npm ERR!
C:\Users\KimeruLenovo\AppData\Roaming\npm-cache\_logs\2020-08 10T09_36_56_388Z-debug.log
Go to the path where you can find the debug log( this file is found in your npm-cache folder)
C:\Users\KimeruLenovo\AppData\Roaming
Delete the NPM and NPM-Cache folder, but DO NOT reinstall node .
once deleted go back to your comand line and re-use the command
" npm install -g npm#latest "
This should do the trick :)

I also had the same issue, Windows 10 with npm v6.4.1 and trying to upgrade node from v9 to v12.18.3.
The problem seemed to be that whenever I tried to install the latest version of node, npm wasn't upgraded and npm v6.4.1 only supported node up until v11 (even though the download page says "Latest LTS Version: 12.18.3 (includes npm 6.14.6)": https://nodejs.org/en/download/).
This Github issue led me to the solution, which was to uninstall node (Settings -> Add or remove programs), then navigate to C:\Users\{User}\AppData\Roaming and delete the npm and npm-chache folder and finally install node again (using the installer).

The problem on my end was arising because I was using NVM yet I had already previously installed NPM independently.
All I did to solve the issue was delete the npm and npm-cache folder located here:
C:\Users\your-username\AppData\Roaming. No need of doing a fresh npm install (just leave that to NVM)

I had the same problem. Delete node and npm cache in AppData folder inside C: drive and install recommended version on another drive.

Go to the path where you can find the debug log (this file is found in your npm-cache folder) C:\Users\yourname\AppData\Roaming
Delete the NPM and NPM-Cache folder, but DO NOT reinstall node. Once deleted go back to your command line and re-use the command " npm install -g npm#latest "

I had same issue.
I tried to install node with choco install -y nodejs.install.
then, npm i works fine.
(before that, nodist was uninstalled)
I used nodist to install node. it may be the cause I think.

I have the same problem even after reinstalling Visual Studio. Cleared caching, and the weird thing, the Node.Js which is installed is the lastest (12.18.3)
So far i've found the node modules of the npm package, in the troubleshooting file they were accuring this solution
"
You can check your npm version by running npm -v.
Steps to Fix
Upgrading on *nix (OSX, Linux, etc.)
(You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.)
You can upgrade to the latest version of npm using:
npm install -g npm#latest
Or upgrade to the most recent LTS release:
npm install -g npm#lts
Upgrading on Windows
We have a detailed guide for upgrading on windows on our wiki.
Proxy and Networking Issues
npm might not be able to connect to the registry for various reasons. Perhaps your machine is behind a firewall that needs to be opened, or you require a corporate proxy to access the npm registry. This issue can manifest in a wide number of different ways. Usually, strange network errors are an instance of this specific problem.
Sometimes, users may have install failures due to Git/Github access issues. Git/GitHub access is separate from npm registry access. For users in some locations (India in particular), problems installing packages may be due to connectivity problems reaching GitHub and not the npm registry.
If you believe your network is configured and working correctly, and you're still having problems installing, please let the registry team know you're having trouble.
Steps to Fix
Make sure you have a working internet connection. Can you reach https://registry.npmjs.org? Can you reach other sites? If other sites are unreachable, this is not a problem with npm.
Check http://status.npmjs.org/ for any potential current service outages.
If your company has a process for domain whitelisting for developers, make sure https://registry.npmjs.org is a whitelisted domain.
If you're in China, consider using https://npm.taobao.org/ as a registry, which sits behind the Firewall.
On Windows, npm does not access proxies configured at the system level, so you need to configure them manually in order for npm to access them. Make sure you have added the appropriate proxy configuration to .npmrc.
If you already have a proxy configured, it might be configured incorrectly or use the wrong credentials. Verify your credentials, test the specific credentials with a separate application.
The proxy itself, on the server, might also have a configuration error. In this case, you'll need to work with your system administrator to verify that the proxy, and HTTPS, are configured correctly. You may test it by running regular HTTPS requests.
"
I'll try to work on it and keep you informed if i'm able to solve this problem

Go to the path where you can find the debug log( this file is found in your npm-cache folder) C:\Users\KimeruLenovo\AppData\Roaming
Delete the NPM and NPM-Cache folder, but DO NOT reinstall node . once deleted go back to your comand line and re-use the command " npm install -g npm#latest "
This should do the trick :)
As mentioned earlier, is that I deleted these folders before installing the new version and also worked.

Start by uninstalling the node js by running npm uninstall -g npm, you will fall back to the previous version of Node.js

Just install what is required from the official site of Node.js https://nodejs.org/en/
No SO version or command lines required

If none of these solutions work which happened to me just go to https://nodejs.org/en/ and download the recommended version manually super fast!

Use n.
I am so glad discovered this package.
if npm installed;
npm install -g n
n lts
for other ways or more details;
https://www.npmjs.com/package/n

My specific case required that I use node 12.14 and I was getting this error.I tried installing the npm version but still was getting this issue
I was using NVM, so I uninstalled all other versions of node using
nvm uninstall 18 And like this all other versions
Before uninstalling the last version, I was getting some error so I ran
nvm deactivate
After which I uninstalled the last remaining node version too
I uninstalled the npm after that, and installed just the node version I needed using NVM
nvm install 12.14
and it installed the required npm too, with it my problem was solved. Hope this would be of use to someone

Related

npm does not support Node.js

npm does not support Node.js v15.5.0 as well as v14.15.3
npm Version: 5.6.0
I upgraded it trough the command: npm i -g npm-upgrade
But I don't get version 6, I always get version 5.6.0
I also tried different Node.js versions according to 426750.
I tried following Node.js versions: v15, v14, v12, v9. It doesn't matter which Node.js version I install, i always get the samme error.
I also removed Node.js and updated it as recommended in 47226238, 63196042.
I have no Idea how I can fix this problem. Do you have any suggestion?
The correct command to update npm is npm install -g npm. At the time of this writing, that will install npm#6.14.10. (If it doesn't, try npm install -g npm#6.)
Installing npm-upgrade instead will install a CLI that updates package.json in projects. It will not update npm itself.
EDIT: The version compatibility stuff is just a warning. Based on the comment below, the ERR! cb.apply is not a function stuff is the real problem. You may have multiple versions of npm or node installed in different paths and your PATH or alias configuration is causing incompatible versions to run with each other.
EDIT (continued): If you are using nvm as a version manager, you can downgrade to a previous version, remove/reinstall the current version of Node.js, and you will have a compatible version of npm. If you are not using nvm, installing it (assuming you are on a development machine and not experiencing these issues in production) and using node and npm provided by it should also solve the issue.
EDIT PART 3: I just noticed you are running Node.js 15.5.0. That ships with npm#7 so do npm install -g npm#7. If that doesn't work, find your executable paths for node and npm. (On UNIX-like operating systems: command -v node and command -v npm.) If they are not in the same directories, that sounds like a problem and you should investigate. It will probably be easiest/best to use the npm that is in the same directory as node. You can try that out by using the full path. If that works, figure out what's wrong with your PATH or your aliases that you're using a different npm and fix that.

Npm isn't getting automatically installed on installing node.js

While hosting my webapp on heroku I got a message of some bugs in my npm package, my npm package was of version 3 and node.js was of version 8, I wrote thinking that I can update my npm version I tried to update it but the version remained same so I decided to uninstall it and wrote the command "npm uninstall " and than again tried to install npm but in vain ,finally I uninstalled my node.js and reinstalled tha npm will automatically get installed with it, but this too didn't work now I have node of version 10 with no npm which I got to know by checking version of npm which gave me message of "command not found ", now my every try to install npm has failed , may anyone suggest me what I can do to restore my losses and resume my work.
I am not sure if you have Linux or Windows. First I would check if the npm folder is in path.
You can follow one of these two to add to path if it is not done yet.
Windows
Linux
Alternatively you can install node with node version manager (nvm):
nvm linux and mac
nvm windows

Not able to install #angular/cli using npm

I am new to "#angular/cli", I have tried every thing but could not install.
I am tired now please some one can help me to install angular 4 "#angular/cli" in my system.
node and npm Version
and when I am installing "npm install -g #angular/cli" then getting
after installing node -v 6 I am getting below erorr
please suggest me where actually I am wrong.
My friend,
Please try: npm cache clean --force. Maybe your npm cache got confused.
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
List of Npm registry
https://registry.npmjs.org/ (Dfault One)
https://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
https://skimdb.npmjs.com/registry
To switch just type
npm config set registry "https://registry.npmjs.org/"
Replace the registry url with the above urls check which one works for you.
I am from india so i used https://r.cnpmjs.org/ and the same error got resolved.
Note: Please use npm cache clear (To clear cache ) and npm cache verify (To verify its clear or not), This Method works for me
Changing Registry location worked for me .
Using :
npm config set registry "https://registry.npmjs.org/"
few warnings but meh! life's too short for warnings.(Every thing is working fine BTW)
It is possible your npm cache has a corrupted file, perhaps it partially downloaded something and then got an error. Try npm cache clean --force and see if that helps.
If that doesn't help look in the log file given in the error message. Find the unexpected end of JSON input message in the log file and look before it to see if there are any other hints to the problem.
You updated your question with a new error message. That one is more specific about the corrupted file. Try removing the cli-1.5.5.tgz file from the path specified and try again. If you are using a web proxy on your network then it is also possible that your proxy has stored a corrupted cache: if you are able then turn off any proxies configured for your system and try a direct download.
Perhaps you are missing space- npm install -g #angular/cli#latest
1) Install node.js and check and node -v in command prompt. (Node.js
through website).
2) npm install -g #angular/cli#latest (run in command prompt).
Refer this link for further help
https://github.com/angular/angular-cli
3) Check node -version
4) Check npm -version
5) check ng -version
If already installed, then uninstall it and install again,
npm uninstall -g #angular/cli
npm cache clean
Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.
Try using different Node version.
First try updating NodeJS(8.9.3) and npm(5.6.0). These are the LTS versions. For Node this can be important! If that doesn't work, follow this installation guide for windows.
Make sure you are not connected to VPN while installation is on.
Also, please cleanup your node_modules folder before your next try. I use the command rimraf node_modules to remove this directory in windows.
Lastly try running npm install -g #angular/cli#latest
run npm install -g #angular/cli#latest in command prompt as an admin.
right click the windows button, click on command propmt (Admin) or windows power shell(Admin) depending on your windows version. Then type the command and run it.
Most times, you could get issues when you want to install as a normal user considering the fact that you are using the -g (global) flag.
We too have the same kind of issue with user login then we tried from Administrator login its worked for us. Please do the same it may fix for you too.
Please try running:
rm -rf node_modules package-lock.json
And this,
npm install
If it still does not work, try to manually install cli:
npm install --save-dev #angular/cli
When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit.
I had the exact same problem, while i was working in a client site, so the problem could be not your environment, they may have a proxy that needs to be configured, in my case we had a nexus server we were going through, and it has something wrong, but when i started using npm registry directly everything worked fine, but most of the time it's a cache problem, to be sure of that you should run:
npm doctor
you will probably find where is the issue.
if not please post the result maybe i can help.
Make sure your console is running as Admin,
Reinstall node & npm
Reinstall angular/cli
Most probable issue is with npm cache. Just clean your npm cache by command
npm cache clean --force
It should work well.
Uninstall your node package. And try the following
Install the latest node package from
https://nodejs.org/en/download/
Check your node and npm version by
node -v
npm -v
Now install the Angular latest version by
npm install -g #angular/cli
Check the angular version by
ng v
Now start creating your application from
https://angular.io/guide/quickstart
So I'm working with Hyperledger which requires you to have a certain Node version 8 and therefore you cannot use the newest angular installation. Perhaps I can recommend another alternative?
cd into the directory
npm install
npm start
You can also clean your npm cache but if one way doesn't work, try the other.
Try navigating to /usr/local/bin and :
if check if the file named ng is present over there, if yes then
rm -r ng and it will remove that file.
Then you can try sudo npm i -g #angular/cli#latest
And it will be a successful install.
(Writing this for those who might also face this issue in future)
Npm cache clean --force
Then install npm
Then go for angular
Npm I -g #angular/cli
was having a similar issue while installing angular cli using npm.
this was resolved by running:
npm cache clean --force
It happened to me once, looked like I had to specify the version of angular cli:
https://github.com/angular/angular-cli/issues/11589
e.g.:
npm install -g #angular/cli#1.5.0
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
Please check this also Perhaps you are missing space- npm install -g #angular/cli#latest

Updating NPM with Nodist

I'm unable to update npm, and get it to use with Nodist.
Whenever I try to update npm with the command
npm install -g npm
the following message comes right after executing it:
(node:5304) fs: re-evaluating native module sources is not supported.
If you are using the graceful-fs module, please update it to a more recent version.
C:\Program Files (x86)\Nodist\v\nodev6.5.0\npm -> C:\Program Files (x86)\Nodist\v\nodev6.5.0\node_modules\npm\bin\npm-cli.js
npm#3.10.6 C:\Program Files (x86)\Nodist\v\nodev6.5.0\node_modules\npm
Doing an npm -v right after, gives me the previous version:
...> npm -v
2.14.10
However, if you noticed the last line in the message above, there is npm#3.10.6 which means it is somehow trying to install that version of npm.
I also followed instructions from this post for Ubuntu users and this for Windows users, but they seem to address issues with standalone NodeJS installations and NOT NodeJS + Nodist combo.
Meanwhile, I was wondering if Nodist itself enables us to update npm, or in other words, does it have any version management feature for npm as well, just as it does for node.
Thanks for any help in advance.
Additional Info
I am using Nodist v0.7.1 on Windows 7.
You can try nodist npm latest
Nodist manages npm versions as well as node versions.
Turns out that Nodist versions prior to v0.7.2 have an issue with getting npm set with Nodist correctly (refer the Nodist changelog).
Performing an npm install -g npm was in fact installing the latest version of npm under the v-x64 in Nodist's root installation folder - which is not where Nodist itself looks for npm installation.
Nodist looks for npm inside the \bin folder:
Solution
Add the bin folder's path to your PATH.
cd to the Nodist installation > bin directory with your terminal,
and then perform:
npm install npm
(not with -g flag of course).
Alternatively, if npm install doesn't work in this step, copy an already installed npm and paste it in the node_modules folder within the bin directory.
As a side note, remember to remove some values from your PATH which I suppose may cause conflicts with global package installations (i.e. with -g flag) with npm, before installing Nodist, which are as follows:
%appdata%\npm; OR C:\Users\username\AppData\Roaming\npm;
%ProgramFiles%\nodejs;
I used to have the same issue.
You should use the following command nodist npm 6.14.5, changing the version you need.
And you can see more option whith this command: nodist --help is where I found the answer:
see an example

Fresh install of npm and node

I have recently started working with Angular 2 and am unable to get the Angular 2 Quickstart project to run correctly due to a number of errors in my npm dependencies.
Am I able to globally uninstall everything that was previously installed with npm to allow me to do a clean install of it and any required dependencies?
Note: The errors are the same as these examples which are caused by packages needing to be installed globally, however, the errors still occur having followed these steps...
To check your global installed packages you can type:
npm ls -g --depth=0
That lists all global installed packages with depth=0. That mean that it doesn't output dependencies of the packages. You can uninstall global packages with:
npm uninstall -g package-name
Please do not uninstall the npm package itself... But you can update your npm version with npm:
npm install npm -g
As mentioned in the Article your Node.js version should be at least v4.x.x and the npm version should be v3.x.x. You can get the installed versions with these commands:
node -v
npm -v
Updating your Node.js depends on your Operating System. Assuming that you use Windows you should uninstall the current version via control panel and download an actual release from the official Node.js page. https://nodejs.org/en/download/current/
To get a great overview how npm works you should consider reading their
documentation: https://docs.npmjs.com/
Make sure you have the correct node.js version. The guide says 5.0 or greater but points you to the wrong download link.
Try this: https://nodejs.org/en/download/current/
With this node you should be able to follow the guide step by step.

Resources