What version of NPM is compatible with Node.js v13.6.0? - node.js

I am currently using Node.js v13.6.0 in Windows 8. When I am trying to install the NPM package, it's showing this:
npm i npm#6.4.1
npm does not support Node.js v13.6.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
npm ERR! code ERR_REQUIRE_ESM
npm ERR! Must use import to load ES Module: C:\Users\microshine\AppData\Roaming\npm\node_modules\npm\node_modules\just-diff\index.mjs
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\microshine\AppData\Local\npm-cache\_logs\2022-04-28T09_17_19_815Z-debug-0.log
My system does not support other versions of Node.js so I have to bear with it. Are there any other alternatives to install NPM with this version of Node?

This same issue happened to me. Then I installed npm#6.12.1, & it works for me so npm install -g npm should fix this issue.
If the problem still happens then try to upgrade to Windows 10 with node v16. it will surely help you.

Related

my npm commands aren't working, npm is bugging?

C:\Users\jason\OneDrive\Documents\Web-Dev-Projects\pinterest-clone>npm install
npm ERR! Windows_NT 10.0.19042
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jason\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v14.17.6
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\jason\OneDrive\Documents\Web-Dev-Projects\pinterest-clone\npm-debug.log
I am getting this really annoying error that doesn't even tell me what's wrong with npm. I tried deleting and installing node.js again and running the command npm install but I would still get the error. I even tried running a command to use the latest version of npm and it still wouldn't work (npm install -g npm-windows-upgrade & npm-windows-upgrade).
It seems like npm is just being very buggy and doesn't want to work. Help please.
Based on this very similar issue, you really shouldn't be using npm 3.x with Node 14.
You might want to uninstall Node, ensure there are no traces of Node or npm on your system, then reinstall Node 14 or 16.
They automatically install newer versions of npm (6 or newer).
Also, the npm-windows-upgrade package you mention hasn't been updated in 3 years. Maybe don't use it?
You are definitely not running the latest version of the tools. NPM is in v7 and Node.js is in v16. Uninstall what you have currently installed, and download the latest version (make sure to choose Current not LTS) to install the latest version. Here is the link
I'd switch to a package manager specifically for managing different versions of Node + NPM side-by-side on your machine, which saves you the hassle of having to have 1 global installation that just "has to work" for all your projects.
Linux has nvm (node version manager). Since you're on Windows, you might want to check out the Windows-"fork": https://github.com/coreybutler/nvm-windows.
It should prevent incompatible versions of node and npm being installed together.

npm WARN npm npm does not support Node.js

npm WARN npm npm does not support Node.js v15.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 6, 8, 9, 10, 11, 12.
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! /home/ubuntu/.npm/_logs/2021-02-22T19_03_54_554Z-debug.log
Node.js 15.x ships with npm 7.x, so this should not be happening if you are using the version of npm installed with the version of node you are running. The mismatch you see typically happens when someone has multiple versions installed through different mechanisms.
So, for example, if the version of node you're using is installed through nvm but somehow (typically through PATH manipulation or setting an alias) the version of npm you are using is from an old package installation, you may see an error like this.
In your case, the version of npm is very old (judging from the fact that it only supports up to Node.js v12.x). While you can upgrade it, that's probably just delaying the problem rather than solving it. Other weird things are likely to happen. You might be better served by running command -v node and command -v npm and figuring out why the npm path provided by that command is so different from the node path, and then fix that. (If they're not very different, then just update npm with npm install -g npm.)
A simple and good solution is to upgrade your npm version or the second option is to downgrade your node version.
Download older node version of Node from here
https://nodejs.org/en/download/releases/

How to fix 'npm does not support Node.js v11.14.0 error' on Windows?

I am configuring my react-native environment. I am attempting to run the react-native command line as described in Facebook's Github documentation here
I have installed the latest version of node.js when I type C:\WINDOWS\system32>node -v v11.14. is returned.
The npm downloaded was included with the latest version of node.js. However it is only 5.5.1. When I input C:\WINDOWS\system32>npm -v the result is 5.5.1
I've tried to uninstall and reinstall
I've tried to download the LTS version of node.js
I've tried to upgrade both node.js and npm
This is for Windows 10
This is running from the administrative command prompt and administrative power shell
This is the code
C:\WINDOWS\system32>npm install -g react-native-cli
npm WARN npm npm does not support Node.js v10.15.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.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! Cannot read property 'startsWith' of null
npm ERR! A complete log of this run can be found in:
When I attempt to clean the cache with npm cache clean -f this is the result
C:\WINDOWS\system32>npm cache clean -f
npm WARN npm npm does not support Node.js v10.15.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.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN using --force I sure hope you know what you are doing.
Edits
The following code is a result of some of the proposed solutions
C:\WINDOWS\system32>npm install -g npm
npm WARN npm npm does not support Node.js v11.14.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/
npm ERR! Cannot read property 'startsWith' of null
npm ERR! A complete log of this run can be found in:
C:\WINDOWS\system32>npm install -g npm-windows-upgrade
npm WARN npm npm does not support Node.js v11.14.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/
npm ERR! Cannot read property 'startsWith' of null
npm ERR! A complete log of this run can be found in:
C:\WINDOWS\system32>npm install -g npm-windows-upgrade
npm WARN npm npm does not support Node.js v11.14.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/
npm ERR! Cannot read property 'startsWith' of null
npm ERR! A complete log of this run can be found in:
I expect to open the npm command line interface. I am receiving errors when I attempt to call the interface.
After installing current NodeJS LTS, I still get
npm does not support Node.js {version}.
I deleted all files in C:\Users\{user}\AppData\Roaming\npm\ and it works.
npm install -g npm-windows-upgrade
npm-windows-upgrade
I deleted node and npm from C:\Users{name}\AppData\Roaming. Then i reinstalled an older version node.js v10.15.3 and npm 6.4.1.
This brings up a different error so I'll be closing this issue...
C:\>npm install -g expo-cli
npm ERR! Cannot read property 'startsWith' of null
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dnort\AppData\Roaming\npm-cache\_logs\2019-04-15T06_32_09_154Z-
debug.log
Simple solution is upgrade your npm version or second option is downgrade your node version.
Download older node version from here
https://nodejs.org/en/download/releases/
How do I update npm?
npm install -g npm
Please note that this command will remove your current version of npm.
Make sure to use sudo npm install -g npm if on a Mac.
You can also update all outdated local packages by doing npm
update without any arguments, or global packages by doing npm update
-g.
Occasionally, the version of npm will progress such that the current
version cannot be properly installed with the version that you have
installed already. (Consider, if there is ever a bug in the update
command.) In those cases, you can do this
You are using an old version of npm. Please upgrade it to the latest.
I faced the same issue using npm, so I was thinking about the alternative of npm. And, you might give the yarn a try.
Firstly, going to https://nodejs.org/en/ to download the nodejs with the LTS version.
Secondly, going to https://yarnpkg.com to download the msi file with the stable version.
Note that the current version of nodejs and yarn are 10.16.0 LTS and 1.17.3 respectively.
After installation, you can install your project packages by using yarn install instead of npm install.
Had the same issue with latest version.
Remove all the NodeJS installation.
For now npm supports node js versions 6, 8, 9, 10, 11.
Go to this version (or older) download the msi file and then do npm install.

Unable to perform "sudo npm install --save firebase-admin"

i'm unable to perform sudo npm install --save firebase-admin in terminal. The error I'm getting is:
npm WARN package.json crypto#0.0.3 crypto is also the name of a node core module.
npm WARN package.json express-resource#1.0.0 No repository field.
npm ERR! Error: Invalid Package: expected types/jsonwebtoken but found #types/jsonwebtoken
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache/add-local-tarball.js:161:14
npm ERR! at process._tickCallback (node.js:448:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 16.1.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "firebase-admin"
npm ERR! cwd /Users/Henry/work_space/ServerMain
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! not ok code 0
I don't see types/jsonwebtoken or anything in my package.json file.
I'm suspecting this could be because my node and firebase is out of date?
my node is 1.4.28 and my firebase is 2.4.2. Let me know if you guys have any ideas!
If you're suspecting that your Node is out of date then have you tried to install it with a newer version of Node? - i.e. What Have You Tried?
First of all your Node is not v1.4.28 but v0.10.38 - read your own question, it's right there.
Node 0.10 was released on March 2013 and stopped being maintained on October 2016. Its current status is "End-of-Life" so don't expect it to work for any new modules, unless those modules explicitly state that they work with that version of Node (which this one doesn't) and even then don't expect it to work well. See the Node LTS schedule:
Node 0.10 uses a very old version of V8 (3.14.5.x) so you can't even use modern JavaScript. By contrast Node 7.2.0 uses V8 version 5.4.500.43. See V8 Changelog to know was changed in the meantime.
Even io.js was forked from Node 0.12 because of not incorporating V8 releases fast enough in 0.12 and you're using a version that's even older than that.
There is no reason to use Node 0.10 when new versions are available for free.
If you don't know how to install a newer version of Node then see my tutorial or Node website.

Why does NVM install think I am using the wrong version of Node?

While trying to install the less node module globally via the Node Package Manager, I ran into an interesting problem that I am having trouble solving. Basically, I am getting an error that claims the node module, less, is incompatible with my version of node. It says I am using node v0.6.12 and that it requires at least v0.8.0 to work.
First I made sure that I was using one of the latest versions of Node:
nvm use v0.10.11
Now using node v0.10.11
node -v
v0.10.11
Then I tried to install the less module globally:
sudo npm install -g less
And got this error message:
npm ERR! error installing less#1.4.0
npm ERR! error rolling back less#1.4.0 Error: UNKNOWN, unknown error '/usr/local/lib/node_modules/less'
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: request#2.21.0
npm ERR! Required: ["node >= 0.8.0"]
npm ERR! Actual: {"npm":"1.1.4","node":"0.6.12"}
npm ERR!
npm ERR! System Linux 3.2.0-45-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "less"
npm ERR! cwd /home/derek
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm not ok
Here you can see that the node package manager is trying to install less using (or thinks it is using) node v0.6.12. It seems as though some others have run into this problem, but his problem turned out to be that he had previously installed node via apt-get, and was resolved by him using the Node Version Manager. I initially installed Node via NVM, however.the Any help that you guys could offer would be greatly appreciated.
Note: It is worth mentioning that it will successfully install using npm install -g less, without sudo permissions. However, as soon as another terminal is opened, the less node module is removed from /usr/local/lib/node_modules, rendering it useless.
Have you tired completely removing the old version, v0.6.12 with something like
sudo apt-get purge node.
I'm not a great with linux, but it seems sudo still has the old version of node in its path and calling npm under sudo is finding it and trying to use it.
The Node.js installed with Linux is probably installed in /usr/sbin/ (at least it was for me on Ubuntu 13.04). That's the old version. Since you have nvm installed and having that manage your Node.js versions, you'll want to point to ~/.nvm/v0.10.11/bin/node.
You already got a nodejs copy on your system.
The solution is to re-install or overwrite your node using /usr/local for your prefix
git clone https://github.com/joyent/node
cd node
./configure --prefix=/usr/local
make
sudo make install
Here is a similar problem:
how to delete node on linux mint 13?

Resources