{"record":{"id":"7b6af81e21347c32","repo":"coreybutler/nvm-windows","slug":"could-not-download-npm-for-node-v-s-please-visit","errorCode":null,"errorMessage":"Could not download npm for node v%s.\nPlease visit %s to download npm.\nIt should be extracted to %s\\v%s","messagePattern":"Could not download npm for node v(.+?)\\.\nPlease visit (.+?) to download npm\\.\nIt should be extracted to (.+?)\\\\v(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/nvm.go","lineNumber":833,"sourceCode":"\t\t\t\terr = utility.Rename(filepath.Join(root, \"v\"+version), filepath.Join(env.root, \"v\"+version))\n\t\t\t\tif err != nil {\n\t\t\t\t\tstatus <- Status{Err: err}\n\t\t\t\t}\n\n\t\t\t\tnpmurl := web.GetFullNpmUrl(version)\n\t\t\t\tif show_progress {\n\t\t\t\t\t// Send special error notification with link to npm release when it cannot be downloaded\n\t\t\t\t\tnotify(Notification{\n\t\t\t\t\t\tTitle:   \"Download Failure (npm)\",\n\t\t\t\t\t\tMessage: fmt.Sprintf(\"Please download npm v%s manually and extract to %s\\\\v%s\", version, env.root, version),\n\t\t\t\t\t\tIcon:    \"error\",\n\t\t\t\t\t\tActions: []Action{\n\t\t\t\t\t\t\t{Type: \"protocol\", Label: \"Manually Download\", URI: npmurl},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\tstatus <- Status{Done: true}\n\t\t\t\t} else {\n\t\t\t\t\tstatus <- Status{Err: fmt.Errorf(\"Could not download npm for node v%s.\\nPlease visit %s to download npm.\\nIt should be extracted to %s\\\\v%s\", version, npmurl, env.root, version), Done: true}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tstatus <- Status{Text: \"Version \" + version + \" is already installed.\", Done: true}\n\t\t}\n\t}()\n\n\t// Wait for the process to complete before exiting\n\twg.Wait()\n\tos.Exit(exitCode)\n}\n\nfunc reinstall(version, cpuarch string) {\n\t// Make sure a version is specified\n\tif len(version) == 0 {\n\t\tfmt.Println(\"Provide the version you want to uninstall.\")\n\t\thelp()\n\t\treturn","sourceCodeStart":815,"sourceCodeEnd":851,"githubUrl":"https://github.com/coreybutler/nvm-windows/blob/5b18223ca19ff50d707f35410dbc6bd440a9f74d/src/nvm.go#L815-L851","documentation":"Terminal error (Done: true) on the no-progress path when npm could not be downloaded for the requested node version. It names npmurl (web.GetFullNpmUrl(version)) for manual retrieval and the exact target directory <NVM_ROOT>\\v<version>. On the GUI/progress path the same condition raises a desktop notification with a 'Manually Download' link instead.","triggerScenarios":"`nvm install <version>` where web.GetNpm fails (mirror down, proxy block) and show_progress is false — i.e. the normal CLI path. Node.exe is installed but node_modules\\npm is absent, so `npm -v` would fail afterwards.","commonSituations":"Air-gapped or proxied networks; npm mirror misconfigured; node installed for a version whose bundled npm tag the mirror does not carry.","solutions":["Follow the message: open the printed npmurl, download the archive for the bundled npm version, and extract it to <NVM_ROOT>\\v<version> (bin\\npm goes to the version root).","Or fix connectivity/mirror (`nvm npm_mirror`, `nvm proxy`), then `nvm uninstall <version>` and `nvm install <version>` again for a clean combined install.","Alternatively bootstrap npm via corepack/manual copy from another installed version directory."],"exampleFix":"# manual completion shown by the message\ncd %NVM_HOME%\\v20.11.0\n# download npm archive from the printed URL, extract so that node_modules\\npm exists and npm.cmd sits in the version root","handlingStrategy":"fallback","validationCode":"# bash: verify npm is reachable before unattended install\ncurl -sfI \"https://github.com/npm/cli/archive\" >/dev/null || echo 'WARNING: npm archive unreachable; node will install without npm' >&2","typeGuard":null,"tryCatchPattern":"nvm install \"$V\"; [ -d \"$NVM_HOME/v$V/node_modules/npm\" ] || { echo 'npm missing — see printed URL for manual extraction'; exit 1; }","preventionTips":["After installs, assert $NVM_HOME/v<version>/node_modules/npm exists in your setup script.","Keep the npm mirror/proxy healthy before batch installs.","Know the manual recovery path: download the npm archive URL from the message and extract it under the version directory."],"tags":["nvm-windows","npm","network","manual-recovery","install"],"backgroundTag":null,"analyzedSha":"5b18223ca19ff50d707f35410dbc6bd440a9f74d","analyzedAt":"2026-08-15T10:06:51.428Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}