Description
In a 64-bit Node.js installation on Windows 11 25H2,
C:\Program Files\nodejs\ is added to the system PATH environment variable
C:\Users\%USERNAME%\AppData\Roaming\npm is added to the user PATH environment variable
and the system PATH takes precedence over the user PATH. This is correctly described.
The statement:
... it will always use the version of npm installed with node instead of the version of npm you installed using npm -g install npm@<version>.
does not hold true for Node.js 26.4.0, nor for the lowest currently supported Node.js 22.33.1.
The workarounds that are described, appear to be unnecessary and obsolete.
Steps to reproduce
- Install https://nodejs.org/dist/v26.4.0/node-v26.4.0-x64.msi with bundled npm 11.17.0 on Windows 11 25H2
- In a cmd command terminal window execute
echo %PATH% and confirm the priority is:
C:\Program Files\nodejs\
C:\Users\%USERNAME%\AppData\Roaming\npm
- Execute
npm --version and confirm that the version shown is 11.17.0
- Execute
npm install npm@11.18.0 -g
- Execute
npm --version and confirm that the version shown is 11.18.0
- Repeat
npm --version in the following and confirm they also show npm 11.18.0
- Windows PowerShell 5.1
- PowerShell 7.6.3
- Git Bash
Repeat for Node.js 22.33.1 with bundled npm 10.9.8. Update to npm@11.18.0.
Suggested solution
Review and revise the documentation section for accuracy regarding currently supported versions of Node.js 22, 24 & 26.
URL
https://docs.npmjs.com/try-the-latest-stable-version-of-npm#upgrading-on-windows
Description
In a 64-bit Node.js installation on Windows 11 25H2,
C:\Program Files\nodejs\is added to the system PATH environment variableC:\Users\%USERNAME%\AppData\Roaming\npmis added to the user PATH environment variableand the system
PATHtakes precedence over the userPATH. This is correctly described.The statement:
does not hold true for Node.js 26.4.0, nor for the lowest currently supported Node.js 22.33.1.
The workarounds that are described, appear to be unnecessary and obsolete.
Steps to reproduce
echo %PATH%and confirm the priority is:C:\Program Files\nodejs\C:\Users\%USERNAME%\AppData\Roaming\npmnpm --versionand confirm that the version shown is11.17.0npm install npm@11.18.0 -gnpm --versionand confirm that the version shown is11.18.0npm --versionin the following and confirm they also show npm11.18.0Repeat for Node.js 22.33.1 with bundled npm 10.9.8. Update to npm@11.18.0.
Suggested solution
Review and revise the documentation section for accuracy regarding currently supported versions of Node.js 22, 24 & 26.
URL
https://docs.npmjs.com/try-the-latest-stable-version-of-npm#upgrading-on-windows