npm does not support Node.js v9.0.0 - node.js

I just upgraded my project to use Node.js v9.0.0. When I start my project using npm, it tells me I should upgrade to a newer Node version, but I believe this is the newest version. I also believe I'm on the newest version of npm (5.5.1).
Do I need to worry about this warning? Is there a good way to resolve the issue?
Here's the full warning:
npm WARN npm npm does not support Node.js v9.0.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.
npm WARN npm You can find the latest version at https://nodejs.org/
Now using node v9.0.0 (npm v5.5.1)

I've just upgraded to Node v9 and ran into the same issue. There's a Github issue for this here.
Following the advice to uninstall a global instance of npm has resolved the issue for me, using:
npm uninstall -g npm

With Node 10.6.0 on Windows 10 with Git Bash installed, I did this and all worked well:
1. Launch Git Bash terminal.
2. cd ~/AppData/Roaming
3. rm -rf npm
4. rm -rf npm-cache
5. npm install -g npm#latest
Check version and test on an existing project to verify (cd to project dir)...
6. npm -version
7. npm install
NB: Performing steps 2 through 4 via Windows Explorer could be faster.

9.0.0 is indeed the latest version available at the moment. The reason that NPM shows you this message is because NPM hasn't updated their unsupported.js yet to accept 9.0.0 as a supported version.
I would say that you can probably use it without problems, but if you stumble upon one, know that it's probably caused by a breaking change in Node.js 9.0.0 and will very likely be fixed by the NPM team soon.

npm does not support Node.js v9.1.0
Uninstall did not work for me
npm uninstall -g npm
Node.js v9.1.0 comes bundled with npm v5.5.1. The latest version of npm is also v5.5.1, however, the version bundled with Node.js isn't exactly the same as the original version from npm.
The following is what I needed to do on MacOS
To completely uninstall node + npm, do the following:
1. go to /usr/local/lib and delete any node and node_modules.
2. go to /usr/local/include and delete any node and node_modules directory.
3. download and install node from nodejs.org

Latest update Jan 2018: NPM has released version 5.6.0 to work with this.
How to upgrade npm:
Note if you are using node version 9 you will not be able to upgrade npm directly, since npm does not support version 9, so using nvm, downgrade node to latest stable release, that will make npm work, then use commandnpm install -g npm#latest to upgrade npm.

Install nvm:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash\n
export NVM_DIR="$HOME/.nvm"\n[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Download and use node X version:
nvm install 4.4.2
nvm use 4.4.2
node -v

[sudo] npm install -g npm#5.3.x remove this problem for me. ubuntu 16.10

Related

nvm / node / npm: newer npm with node 12 than with node 14?

I'm using nvm to build libraries that require specific (different) Node versions.
When I do:
nvm use 12
I get:
Now using node v12.21.0 (npm v8.14.0)
But when I do:
nvm use 14
I get:
Now using node v14.18.1 (npm v6.14.15)
I'm very surprised to see an older npm version with a newer Node version. Is that the way it's supposed to be?
When I do nvm use 14 I'd expect it uses the latest Node 14.x with whatever latest npm version is available for that Node version. Or am I misunderstanding how this works?
Node.js is distributed with a version of npm, but npm is still a seperate package that can be upgraded.
The distributed versions can be retrieved from node release info
node npm
v12.22.12 6.14.16
v14.20.0 6.14.17
v16.17.0 8.15.0
v18.9.0 8.19.1
npm can prompt you to upgrade when it detects an old version, and you will also to run into this instruction in the wild a fair bit:
npm install -g npm
This will grab whatever the latest version of npm is and is likely what happened in the nvm 12 environment.
Sometimes moving to a new major version of npm can be a source of trouble for projects that have already been setup with a previous major npm release and some behaviour changes. CI tasks often have a npm install -g npm and one day they start falling over for what seems like no change. I've also seen npm drop support for an old version of node, so a npm install -g npm ends up with a broken npm.
If you want to keep a fixed major release, like v6 that Node 12 was release with, use:
npm install -g npm#^6
or to use a specific version
npm install -g npm#6.14.16

How do I upgrade npm to support Node.js v14.0.0 on MacOS?

I've recently installed newest version of node 14.0.0 on my computer (macOS Catalina). Wanted to start new project with. Initially I wanted to install express with npm install --save express and got below warning logs:
npm WARN npm npm does not support Node.js v14.0.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 6, 8, 9, 10, 11, 12, 13.
npm WARN npm You can find the latest version at https://nodejs.org/
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN ProjectName#1.0.0 No repository field.
I am wondering if this is issue on my setup side and I should reinstall node (possibly downgrade?) or something different.
Thank you for you patience and support!
Try :
Mac:
sudo npm uninstall -g npm // uninstalls globally
Windows:
npm uninstall -g npm // uninstalls globally
Then:
Re-install node
NOTE: Ensure that your PATH points to where node is installed
e.g. If node installed at /usr/local/bin/node, ensure /usr/local/bin is in your PATH
For windows. Follow this instructions here https://github.com/coreybutler/nvm-windows
PREREQUISITE: Uninstall existing node & npm
Install nvm-windows
Run nvm install <version>
Run nvm use <version>
This happens due to dependencies from libraries like Heroku or yarn etc.., . Another hack-of-a-solution if you are stuck on this issue on MAC or any unix based system is:
Step 1: cd /Users/username/
Step 2: Do a ls -ltrh to list hidden files and locate .npm/ and .npm-packages/
Step 3: Sudo rm -rf .npm/
Step 4: Sudo rm -rf .npm-packages/
Step 5: Run brew reinstall node
Step 6: Run npm install -g npm#7.13.0 or any other version if there is a minor update needed
Step 7: Run npm install -g #angular/cli or any other framework to test
Step 8: Check versions node -v and npm --version
This issue should now be resolved.
on windows:
*Uninstall node.js (Windows Add/Remove programs)
*Manually delete the npm folder from your user profile (%APPDATA%/roaming/npm)
*Install node.js (from Windows 10 LTS download MSI)

npm WARN npm npm does not support Node.js v9.1.0

I updated to the latest node v9.1.0 and now npm doesn't work.
npm WARN npm npm does not support Node.js v9.1.0
It turns out that the current installed npm is not compatible with the new node and has a hard time updating.
The solution is to uninstall npm and then reinstall node which will contain the correct version of npm.
Here's how:
Uninstall npm.
Mac:
sudo npm uninstall -g npm
Windows:
npm uninstall -g npm
Install node from https://nodejs.org
Uninstall the global instance of npm:
npm uninstall -g npm
This will cause your system to fall back on the version of npm installed by node 9.1.0 and the warning will disappear.
What worked for me was to delete npm and npm cache from C:\Users\chrisd\AppData\Roaming
Then I ran npm i -g npm#next for the latest version of npm for Node 9.x
NPMJS.org has issued a new release 11.27.2017 -- npm v5.6.0
(You may not have to delete the npm/npm cacheif you just upgrade, but I had already done that before finding the new release)
NPMJS Release notes
Fixed my issue update to 5.71
npm uninstall -g npm
npm i -g npm#next
Had similar issue in linux/ubuntu, below helped solving it.
Remove existing versions of npm and node:
sudo apt --auto-remove purge npm
sudo apt --auto-remove purge nodejs
Re-install node
for me worked
npm uninstall -g npm
npm i -g npm#next
No need for manual installation or clearing the cache.
Run with admin credentials if needed.
I saw this warning after I upgraded to Node 10.4.1 after that I just ran npm uninstall -g npm with -g flag to remove it globally and the error was gone. I guess it updated my npm to version 6.1.0
Solution :
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 "
What worked for me - On Ubuntu
Install nodejs
sudo apt install nodejs
Install npm
curl -L https://www.npmjs.com/install.sh | sudo sh
If you are unable to uninstall npm, instead you can skip that step and just
Reinstall npm https://nodejs.org/en/
This error occurs when the npm version not compatible with the node version. However npm uninstall -g npm also gives the same error for me.
So following steps work for me.
Option 1:
Step1: Follow this directory
C:\Users(your username)\AppData\Roaming
Step2: Delete the npm folder. And if there is a folder called `npm cache, delete it also.
Step3: Run npm clean cache —force ( — force is now required to clean cache)
If the above option is not worked for you please follow the below steps.
Option 2:
Follow this directory
C:\Users(your username)\AppData\Roaming
Delete the npm folder and if there is one mom cache folder.
Run npm clean cache --force ( -- force is now required to clean cache)
Make sure everything to do with Nodejs is deleted and uninstalled.
Reinstall Nodejs.
I had the same issue with npm when I have updated Node js on windows. I tried many things but only working solution was :
First uninstall npm with below command
npm uninstall -g npm
Now Install latest version
npm install npm#latest -g
If you are using Mac and brew, that's how I've got rid of this problem:
Even though I installed and reinstalled node with brew, with last version 11.8.0, apparently it kept using the last version
fdecollibus$ npm install --global gatsby-cli
npm WARN npm npm does not support Node.js v11.8.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/
/usr/local/Cellar/node/11.8.0/bin/gatsby -> /usr/local/Cellar/node/11.8.0/lib/node_modules/gatsby-cli/lib/index.js
+ gatsby-cli#2.4.8
npm -v gave me back version 5.6.0. I've therefore noticed that /usr/local/lib/node_modules had wrong permissions assigned to root:wheel.
A chown did not fix the problem: I've had to manually delete the content of the folder (cd /usr/local/lib/node_modules and -careful - type rm -rf * ) to get rid of the folder.
Then I've run brew uninstall node and again brew install node, and finally npm -v gave me back 6.5.0
Executing npm uninstall -g npm gave me same error
Uninstall Node.js installed in the system
Goto c:\Program File\nodejs (default location of the nodejs installation). Remove all contents of the folder manually.
Remove npm, npm-cache folder from Roaming folder under your username.
Install Node.js again.
running npm install #angular/cli -g worked for me.
I was getting the below warning when I executed, npm install to install package.json for my angular project.
npm WARN npm npm does not support Node.js v9.1.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.
npm WARN npm You can find the latest version at https://nodejs.org/
WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.ng-080b84bf08dd68e5.lock for ...\Angular\node
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above.
C:\Program Files\nodejs\node.exe: src\node_zlib.cc:437: Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.
According to #Ilyich, I uninstalled global npm, npm uninstall -g npm
And then I executed npm install to install my package, it installed successfully.
Navigate to the Appdata by typing %AppData% in the run or search.
Delete the npm and npm-cache folder and then install the nodejs again. It solved the issue for me.
If you are getting the same warnings while creating or importing an Angular project in an IDE such as Eclipse ,do the following:
File->New->Angular
In the window that appears change the versions of Nodejs and NPM to "use system installation"
...
If the process crashes at "installing packages for tooling via npm"
Close the terminal in IDE and manually go to the project directory and do "npm install".
Refresh the project in IDE
I had a similar issue trying to install other stuffs.
And looks like the npm version was not compatible with my node version.
In my case i had npm 5.4.2 and node v10.15.0
At the end of this process i had the version npm 6.7.0 and node v10.5.0
First Option:
I downgrade the version of node and other tools.
On terminal execute the next command with the version to be installed. (Example if we need change to node 8.14.1)
1.- Npm install -g node#8.14.1
Then we execute the command to uninstall the version to be removed.
2.- Npm uninstall -g node#8.15.0
After that we need execute the next command to set the new path
3.- Npm update -g node#8.14.1
Finally we only need execute the version to see if the changes were added successfully
4.- Node -v
In this case we will see the version as 8.14.1 and we finished the process.
If you want do it for Appium and Npm version you can open a new terminal and follow the same steps in order to change the version. For example:
Npm install -g appium#1.7.2
Npm uninstall -g appium#1.10.0
Npm update -g appium#1.7.2
Appium -v
In my case you must have the next versions:
Node 8.14.1
Npm 6.4.1
Other Way:
To solve it i just execute in the terminal the next line.
curl -L https://npmjs.org/install.sh | sh
After download a few files (took around of 10 minutes to see results in the terminal) i was able to continue working with the new latest and compatible version of both tools.
The next WARM was displayed in this case.
npm WARN npm npm does not support Node.js v10.15.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.
npm WARN npm You can find the latest version at https://nodejs.org/
/Users
I am on a macOS and what ended up working for me was uninstalling npm, relinking Node, and reinstalling Node through Homebrew. (Prereqs: Have Homebrew installed and have a very confusing setup where npm and Node don't work together)
1. To uninstall homebrew:
If you are on a Mac, you probably don't see the AppData\Roamingfolder; you should instead go to npm root -g and delete the npm_modules folder. Now, when you type npm --version your computer should be confused.
2. Reinstalling node:
Try doing brew install node and if you already have node installed, your computer will ask you to reinstall it. If you do brew reinstall node and your versions of brew and npm look good, then you don't need to do the last step!
3. If you need to link the correct version of Node:
This step was something I think was my fault since I think I had installed Node through Homebrew as well as the actual online download. Follow the suggestions after brew link node which should take you to brew link --overwrite node. There will be around 7 directories that the command will not be able to overwrite, which you should all delete using sudo rm -rf directory_name. (Do use your common sense, don't delete something important.) After you are finally able to run the brew link --overwrite node command without any errors, you should then do brew reinstall node since you don't have npm anymore.
Tada! You hopefully now have version of npm and node that hopefully can work together.
Just install latest version of Node.js from https://nodejs.org
This will automatically update npm for you
Easiest way I found was to install the latest node with brew and the latest npm manually:
brew uninstall node
brew install node
npm install -g npm#latest
This removed the warning message. For some reason brew wasn't linking the new npm installed by node while it was updating node itself.
The easiest way(for windows) is to use the installer to remove node, then use it to reinstall node, at which time it will install the correct version of npm. running the above uninstall commands does not work, since the wrong version of node is installed, otherwise you wouldn't have this issue.
You can uninstall node current version, and install a early version that support npm. Then run npm install npm#latest -g and install current node version.
It's work for me
lowering the npm version worked for me (windows 10):
npm i npm#6.14.11
To upgrade the npm and Node:
Step 1. Uninstall the npm:
Mac: `sudo npm uninstall -g npm`
Windows: `npm uninstall -g npm`
Step 2: Install the latest version of Node: https://nodejs.org/en/

Downgrade npm to an older version

I tried updating npm to see if it would solve some dependency problems we were having, and now I want to downgrade to the version the rest of the development team is using. How can I install an older version?
I updated npm according to the instructions on the About npm CLI versions:
The latest release of npm
The latest release of npm is the most recent stable version. When you install Node.js, npm is automatically installed. However, npm is released more frequently than Node.js, so to install the latest stable version of npm, on the command line, run:
npm install npm#latest -g
Just replace #latest with the version number you want to downgrade to. I wanted to downgrade to version 3.10.10, so I used this command:
npm install -g npm#3.10.10
If you're not sure which version you should use, look at the version history. For example, you can see that 3.10.10 is the latest version of npm 3.
Just need to add version of which you want
upgrade or downgrade
npm install -g npm#version
Example if you want to downgrade from npm 5.6.0 to 4.6.1 then,
npm install -g npm#4.6.1
It is tested on linux
npm install -g npm#4
This will install the latest version on the major release 4, so no need to specify version number. Replace 4 with whatever major release you want.
Even I run npm install -g npm#4, it is not ok for me.
Finally, I download and install the old node.js version.
https://nodejs.org/download/release/v7.10.1/
It is npm version 4.
You can choose any version here
https://nodejs.org/download/release/

npm -v still showing version 2.x.x after installing npm3

I am starting to use Angular 2, which requires npm 3.x.x, so I installed it with npm install -g npm3. The Angular 2 tutorials tell me to verify that I have npm 3.x.x by running npm -v, however when I run that, it still says I have version 2.15.8. It shows that I have version 3.10.7 if I run npm3 -v, but not if I run npm -v. Is this going to cause errors? Do I need to it to say I'm using version 3.x.x when I run npm -v? If so, what do I need to do?
EDIT:
Node.js version: node -v reveals that I am using v4.4.7 (Angular2 requires something between 4.4.x - 5.x.x, so I should be good here)
OS: I am currently using Windows 10 on a PC, but have had the same issue with my Mac.
Upgrade npm using this command - npm install -g npm
Maybe this helps:
https://www.google.de/search?q=update+npm+windows
Updating npm with npm itself will store npm.cmd in ../appdata/roaming/.
To avoid conflicts with an older npm version you need to remove npm.cmd from C:\Program Files\nodejs\npm.cmd

Resources