Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm not running #52629

Closed
4 tasks done
prabeshkunwar12 opened this issue Apr 21, 2024 · 0 comments
Closed
4 tasks done

npm not running #52629

prabeshkunwar12 opened this issue Apr 21, 2024 · 0 comments

Comments

@prabeshkunwar12
Copy link

Version

v20.12.2

Platform

windows

Subsystem

No response

What steps will reproduce the bug?

Context

  • 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

@prabeshkunwar12 prabeshkunwar12 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant