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

Bad arch detection

Open ZebraFlesh opened this issue 9 years ago • 6 comments

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:

  1. 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)
  2. Install the VM in the container of your choice (I've tried both VMWare and VirtualBox)
  3. Boot up the VM, verify it's a 32-bit instance (System Properties as well as wmic OS get OSArchitecture from the command prompt)
  4. Install nvm-windows 1.1.1
  5. Refresh $PATH as necessary
  6. Execute nvm arch and receive the output: System Default: 64-bit. Currently Configured: -bit.
  7. Execute nvm install 4.4.0 followed by nvm use 4.4.0: node 4.4.0 (64-bit) downloads and installs without issue
  8. Execute node -v and see the message This 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.

ZebraFlesh avatar Aug 27 '16 02:08 ZebraFlesh

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.

coreybutler avatar Aug 27 '16 16:08 coreybutler

The settings file does not contain an arch setting.

ZebraFlesh avatar Aug 27 '16 18:08 ZebraFlesh

Hm. Is arch even listed, or is it just blank?

coreybutler avatar Aug 27 '16 18:08 coreybutler

It was not even listed

ZebraFlesh avatar Aug 27 '16 23:08 ZebraFlesh

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.

espoelstra avatar Nov 07 '16 22:11 espoelstra

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.

alshain avatar Apr 25 '17 12:04 alshain