NVM Windows Installation Error: npm File Not Found
Problem Statement
When using Node Version Manager (NVM) on Windows to install specific Node.js versions, you may encounter an npm file not found error. This typically occurs during the npm installation phase, with an error message like:
Downloading npm version 6.14.13... Complete
Installing npm v6.14.13...
error installing 14.17.3: open C:\Users\User\AppData\Local\Temp\nvm-npm-2947621574\npm-v6.14.13.zip: The system cannot find the file specified.
This error prevents successful Node.js installation and occurs because of a path resolution bug in recent versions of NVM for Windows. The installation process fails to locate the downloaded npm zip file in the temporary directory.
Solution
Primary Method: Downgrade to NVM v1.1.12
This issue stems from a known bug in recent NVM versions (GitHub issue #1209). The most reliable solution is to downgrade to NVM version 1.1.12:
Manual Installation Method
Uninstall current NVM version:
- Windows → Control Panel → "Programs and Features" → Uninstall "nvm-windows"
Download NVM v1.1.12:
- Visit the GitHub release page
- Download
nvm-setup.zip
Install NVM v1.1.12:
- Extract the ZIP file
- Run
nvm-setup.exe
with administrator privileges - Follow the installation prompts
Verify installation:
bashnvm version # Should output: 1.1.12
Install Node.js:
bashnvm install 14.17.3
Chocolatey Installation Method
For users who originally installed NVM using Chocolatey:
choco install nvm.install --version 1.1.12 -f
- When prompted about file changes, type
A
and press Enter - Confirm any dialog boxes with "Yes"
After installation, verify with nvm version
and install your Node version.
Compatibility Note
NVM v1.1.12 works with all Node.js versions and preserves your existing Node installations in %LOCALAPPDATA%\nvm
.
Secondary Method: Check for Fixed Versions
If a newer NVM version with the fix is available:
- Check the GitHub releases page for versions after 1.1.12
- Verify closure of issue #1209
- Install the fixed version using standard upgrade procedures
WARNING
Manually placing npm files (as suggested in some older solutions) is error-prone and not recommended. The downgrade method is more reliable and maintainable.
How It Works
The bug occurs in the npm installation phase of some NVM versions when temporary file paths aren't properly resolved. Version 1.1.12 doesn't contain this path resolution issue, making it stable for legacy Node.js installations.
This solution guarantees:
- Correct npm installation alongside Node.js
- Preservation of existing Node versions
- No manual file manipulations required
- Compatibility with both current and legacy Node versions
Post-Installation Verification
After successful installation:
nvm ls # List installed versions
nvm use 14.17.3 # Activate the installed version
node -v # Verify Node version
npm -v # Verify npm version
Best Practice
Use nvm use [version]
consistently to switch between Node versions. Your installed Node versions remain accessible across NVM downgrades/upgrades.
Long-Term Solution
When an official fix is released in newer NVM versions:
- Check the GitHub releases page
- Install the fixed version
- Remove v1.1.12 if no longer needed
Monitor the GitHub issue tracker for resolution updates to migrate back to current versions when available.