nvm-windows icon indicating copy to clipboard operation
nvm-windows copied to clipboard

nvm install of node gives broken node installation on Windows 11

Open dwschulze opened this issue 3 years ago • 1 comments

Install nvm-setup.exe on Windows 11 Run nvm install lts nvm use lts Executing node gives this error:

C:\Users\h279518>node version node:internal/modules/cjs/loader:959 throw err; ^

Error: Cannot find module 'C:\Users\h279518\version' ←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)←[39m ←[90m at Function.Module._load (node:internal/modules/cjs/loader:804:27)←[39m ←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m ←[90m at node:internal/main/run_main_module:17:47←[39m { code: ←[32m'MODULE_NOT_FOUND'←[39m, requireStack: [] }

C:\Users\h279518>nvm list

  • 16.17.0 (Currently using 64-bit executable)

dwschulze avatar Aug 23 '22 14:08 dwschulze

Do you have a prior version of Node installed?

On a fresh Win11 machine, I cannot recreate this: image

This makes me think a prior installation may be conflicting with NVM. To check, use PowerShell to run gcm node.exe, which will tell you where Windows is looking for the node executable. For example:

image

If the Source doesn't match your NVM_LINK, then another Node installation is preventing the NVM4W node installation from being run.

coreybutler avatar Aug 23 '22 17:08 coreybutler

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 23 '22 02:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Sep 30 '22 02:09 github-actions[bot]