Recently, I had the opportunity to work on an Ionic project, for which I needed to set up Node.js on my Windows machine. I attempted to install multiple versions of Node.js by first installing nvm for Windows and then using the nvm command to install specific versions of Node.js from the command prompt.
but get below error:
Could not retrieve https://nodejs.org/dist/latest/SHASUMS256.txt.
If you're facing the same error "Unable to install node using nvm on Windows Access is denied getting error: Could not retrieve https://nodejs.org/dist/latest/SHASUMS256.txt," you can resolve it by following these steps:
set HTTPS_PROXY=https://proxy-server-url:port
nvm install latest
set NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
You can try this solution:
Launching PowerShell as an administrator might provide the necessary permissions for nvm to function properly, especially if the error is related to access rights. Toggling nvm off and on can sometimes reset its internal state, resolving any configuration conflicts that might be causing the issue.
We might need to run the following command:
nvm proxy [url_proxy_server]
For example:
nvm proxy http://test.com:8080
If the issue persists, we can try another solution. I encountered a similar issue before, and adding a 'v' prefix before the actual version number worked perfectly for me.
You can try this:
nvm install v14.18.0
Setting the proxy server using the nvm proxy
command can be helpful if our network requires it for external connections. This command tells nvm to use a specific proxy server for downloading node.js versions and packages.
Adding the 'v' prefix before the version number might resolve any compatibility or parsing issues with nvm. Sometimes, the version format expected by nvm can vary, and adding the 'v' prefix ensures that nvm recognizes the version correctly.
We encountered the same error while trying to install a different version of NodeJS. The error message stated that it could not retrieve https://nodejs.org/dist/latest/SHASUMS256.txt
.
We found that running nvm install latest
worked correctly after disconnecting from the VPN and opening PowerShell in admin mode. We suggest trying this approach.
Additionally, when facing similar errors on our Windows machine, switching from the stable version to the LTS (Long-Term Support) version resolved the issue for us. We used the following commands:
nvm install lts
nvm use lts
Running nvm install latest
without the VPN and in admin mode might bypass any network restrictions or permissions issues, allowing the installation to proceed smoothly.
Switching to the LTS version ensures a more stable and supported version of NodeJS, which might have better compatibility with our environment.
It seems that something is blocking our inbound connection at the network level. In this situation, NVM4W is merely delivering the message. We've noticed that older versions of Windows servers often have a tightly locked-down firewall, so our first step would be to check there. We should try accessing those URLs from a browser on the server to see if they are accessible.
Another possibility is that the Windows Certificate Trustchain doesn't recognize the TLS/SSL certificate of the remote server. In such cases, we can add --insecure
to the end of the command to bypass the TLS/SSL validation step. However, we're inclined to believe it's more likely a firewall issue because TLS/SSL doesn't usually timeout when there's a problem; instead, it typically indicates that the remote host isn't trusted.
Regarding the firewall issue, if it turns out to be the case, we might need to adjust the firewall settings to allow access to the necessary URLs. If adding --insecure
resolves the issue, it's a temporary workaround, but we should still investigate and address the root cause, which could be related to network security configurations.