nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getting latest version of npm

mwoodpatrick opened this issue · comments

Operating system and version:

WSL version: 1.0.1.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22623.891

See attached file for nvm ls & debug output

nvm debug output:

nvm ls output:

[nvm_ls.txt](https://github.com/nvm-sh/nvm/files/10092519/nvm_ls.txt)

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

What steps did you perform?

Looking at
nvm use v18.12.1
nvm uninstall v19.1.0
nvm install v19.1.0

What happened?

Looking at "nvm ls" it seems like that latest stable version of node supported is v19.1.0

node --version -> v19.1.0
npm --version ->8.19.3
which npm -> /home/mwoodpatrick/.nvm/versions/node/v19.1.0/bin/npm

What did you expect to happen?

I would have expected that npm would have the current version.

If I do

curl -qL https://www.npmjs.com/install.sh | sh
which npm -> /home/mwoodpatrick/.nvm/versions/node/v19.1.0/bin/npm
npm --version -> 9.1.2

How do I get the latest npm version installed by default

nvm install-latest-npm is how you do this manually, nvm install whatever --latest-npm is how you do it at the time of installing node.

By default, the npm version you get is the one that ships with node. There will not be any way to change this default.