I ran npm -v and it listed a version (I can't remember exactly which) something like 0.6.1.
I ran npm install nodejs-latest to try an update my package. It went to version 6.6.0
I unstalled node.js completely, redownloaded and installed from https://nodejs.org/en/
Checked npm -v and it returned 6.5.0
I ran this suggestion from stackoverflow: How can I update npm on Windows?
It lists out the versions available to install and it only goes up to 6.7.0
I'm totally lost. Why can't I get the current version of node.js on this machine?
Npm is the Node Package Manager, when you run "npm -v" it will show you the npm version and the "node -v" will show you Node version.
To update npm version you should run npm install -g npm .
To update the node version you can download it at the NodeJs website.
Or you can this steps to update.
Related
Currently on version 8.5.3 and trying to downgrade to v6. The output seems fine but the result is still 8.5.3 even after restarting shells/OS:
PS C:\Users\myUser> npm install -g npm#latest-6
removed 384 packages, changed 3 packages, and audited 54 packages in 8s
found 0 vulnerabilities
PS C:\Users\myUser> npm --version
8.5.3
Powershell is being run with administration privileges, due to some errors when running it without privileges.
Instead of using:
npm install -g npm#latest-6
Use this:
npm install -g npm#6.14.16
And after that reboot (restart) your computer
for your version please use
npm install -g npm#6.14.4
for latest version please use
npm install -g npm#latest
I'm seeing an error when attempting to install the latest cypress on my Windows 10 machine. I was using cypress 8.7 just fine. I deleted node_modules and package-lock.json and removed "cypress": "^8.7.0", from package.json.
Now installing cypress (9.1) I see this error:
npm install --save-dev cypress
npm ERR! Error: Cannot find module 'har-validator'
I see the same error when trying to use the old version too
npm install --save-dev cypress#8.7.0
System info from powershell:
node -v
> v16.8.0
npm -v
> 7.21.0
UPDATE:
My friend is able to install with dependency 8.7.0 in package.json, on OSX with nodejs 14.16.0.
This works today (2021-11-26) for me
npm install --save-dev cypress#8.7.0
There is a Bug in #cypress/request.
Take a look at https://github.com/cypress-io/request/pull/15
EDIT: There is a PR from one of the devs. https://github.com/cypress-io/request/pull/16
Looks like Cypress issue with latest versions. we have this problem for v8.7.0 today. "npm install har-validator" manually installed the missing har-validator module, that helped.
npm install docsify -g installs an old version ('4.3.0', while latest dev version is '4.9.4' (on git-hub)).
So I cloned the git repo, and from there ran npm install, but that seems not to do anything useful; at least there is no docsify executable in my PATH afterwards.
(on Debian testing)
npm install [git_url]
Just like this.
If I have an old version of node (for example downloaded from Ubuntu repos), and I use sudo npm install #angular/cli -g, will that download the last version of #angular/cli that is known to work with that version of node, or will that always install the latest version of #angular/cli, even if that version is incompatible with my version of node?
I'm asking because I encountered a problem that makes me think that the second variant is what takes place. But at the same time, my experience with package managers like apt-get has led me to believe that they generally make sure to install compatible versions - apt-get will not install packages for Ubuntu 17.10.1 if your distro is Ubuntu 16.04.3 LTS, for example.
So I'm curious to know if npm behaves more like apt-get in that regard, or not.
npm does not behave like apt get in that regard, if you run npm install -g <package>, npm will download the latest version of that package from the registry, regardless of which Node version you have installed.
We can actually test this using the #angular/cli example. As can be read on the project's homepage:
Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.
So if I downgrade my Node version to the final 5.x release:
$ nvm install 5.12.0
Downloading and installing node v5.12.0...
Downloading https://nodejs.org/dist/v5.12.0/node-v5.12.0-linux-x64.tar.xz...
######################################################################## 100,0%
Computing checksum with sha256sum
Checksums matched!
Now using node v5.12.0 (npm v3.8.6)
And then run npm install #angular/cli -g, you can see that npm couldn't care less which version of Node I am running:
$ npm ls -g --depth=0
/home/jack/.nvm/versions/node/v5.12.0/lib
├── #angular/cli#1.7.1
└── npm#3.8.6
As a side note, you might want to look into using a Node version manager, as this will mean you don't need to run npm install using sudo. Here's a good guide if you're interested. This is especially relevant in regard to the recent npm shenanigans (ref.: Unlucky Linux boxes trampled by NPM code update, patch zapped)
When attempting to install Browser-syn [sudo npm install -g browser-sync] on Ubuntu, it gets stuck, the last readout is [loadDep:is-fullwidth-code].
I have been trying various solutions pertaining issues with npm, to no avail.
I made it to work.
I removed nodejs v4.2.6 (that came with Ubuntu 16.04), an old package manager npm was also removed.
I installed nodejs v6.11.5 (that came with npm v3.10.10) following instructions on https://nodejs.org/en/download/package-manager/.
I used npm to install browser-sync [$ sudo npm install -g browser-sync]
as indicated on https://www.browsersync.io/.
It worked this time.