You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue occurs after upgrading Node.js from a previous version to 20.12.2.
Prior to the upgrade, npm was functional.
The error message indicates that the npm module cannot be found in the specified path.
Steps Taken
Attempted to reinstall npm using both prebuilt installer and Chocolatey package manager.
Verified that Node.js is installed correctly and accessible via the node command.
Checked system environment variables and verified that the PATH includes the directory where npm should be installed.
Resolution Steps
Check the npm installation directory for any missing or corrupted files.
Ensure that the PATH environment variable includes the directory where npm is installed.
Try reinstalling npm using a different method.
Consider downgrading Node.js to a previous version where npm was functioning correctly.
How often does it reproduce? Is there a required condition?
Everytime
What is the expected behavior? Why is that the expected behavior?
Expected Behavior
After upgrading Node.js, npm should continue to function as expected without any errors.
Running npm -v should output the version of npm installed.
# verifies the right NPM version is in the environment
npm -v # should print `10.5.0`
What do you see instead?
After upgrading Node.js to version 20.12.2, the npm command is not functioning as expected. When attempting to run npm -v, the following error is encountered:
npm -v
node:internal/modules/cjs/loader:1146
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.12.2
Additional information
No response
The text was updated successfully, but these errors were encountered:
Version
v20.12.2
Platform
windows
Subsystem
No response
What steps will reproduce the bug?
Context
Steps Taken
node
command.Resolution Steps
How often does it reproduce? Is there a required condition?
Everytime
What is the expected behavior? Why is that the expected behavior?
Expected Behavior
npm -v
should output the version of npm installed.What do you see instead?
After upgrading Node.js to version 20.12.2, the npm command is not functioning as expected. When attempting to run
npm -v
, the following error is encountered:Additional information
No response
The text was updated successfully, but these errors were encountered: