Bad arch detection
If this is a question about how to use NVM4W, please use stackoverflow instead.
If this is an issue regarding antivirus, make sure you search the existing issues first.
My Environment
- [ ] Windows 7 or below (not truly supported due to EOL - see wiki for details)
- [ ] Windows 8
- [X] Windows 8.1
- [ ] Windows 10
- [ ] Windows 10 IoT Core
- [ ] Windows Server 2012
- [ ] Windows Server 2012 R2
- [ ] Windows Server 2016
- [ ] My Windows installation is non-English.
I have already...
- [X] read the README to be aware of npm gotchas & antivirus issues.
- [X] reviewed the wiki to make sure my issue hasn't already been resolved.
- [X] verified I'm using an account with administrative privileges.
- [X] searched the issues (open and closed) to make sure this isn't a duplicate.
- [X] made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.
My issue is related to (check only those which apply):
- [ ] settings.txt
- [ ] proxy support
- [X] 32 or 64 bit support
Expected Behavior
nvm prints help indicating that nvm install "defaults to system arch". I'm running a 32-bit OS so I expected it to download a 32-bit version of node.
Actual Behavior
nvm is installing 64-bit versions of node, likely due to the fact that Windows is a guest OS in a virtual container.
Steps to reproduce the problem:
- On a 64-bit OS (such as OS X), grab an IE 11 on Win 8.1 virtual machine from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ (this seems to always come as a 32-bit OS; there's no architecture selection)
- Install the VM in the container of your choice (I've tried both VMWare and VirtualBox)
- Boot up the VM, verify it's a 32-bit instance (System Properties as well as
wmic OS get OSArchitecturefrom the command prompt) - Install nvm-windows 1.1.1
- Refresh $PATH as necessary
- Execute
nvm archand receive the output:System Default: 64-bit. Currently Configured: -bit. - Execute
nvm install 4.4.0followed bynvm use 4.4.0: node 4.4.0 (64-bit) downloads and installs without issue - Execute
node -vand see the messageThis version of C:\Program Files\nodejs\node.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.
Work around: explicitly specify arch during installation: nvm install 4.4.0 32. Likely adding the arch to the settings.txt file would also work, but I didn't try that.
nvm arch 32 should set the default for you.
I'll have to look at why it's not autodetecting this. Is your settings file showing 64-bit architecture? I suspect it is, and I suspect the installer is to blame in this case.
I won't have time to look into this for a little while. If someone else does, the test to perform is building from source on a clean 32-bit system as opposed to using the installer. If it properly shows 32-bit when built from source, it signifies the problem is in the installer. Otherwise, it's in the code base.
The settings file does not contain an arch setting.
Hm. Is arch even listed, or is it just blank?
It was not even listed
I'll have to look at how nvm4w is determining the OS bitness, but if it was looking at the CPU capabilities I would definitely expect to see this more on 32 bit machines running on a 64 bit capable system.
I'm experiencing the exact same issue on Windows 7 32bit with a 64 bit CPU. Unlike @espoelstra 's install, this is a native installation, not virtualized.