nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
79.11k stars 7.92k forks source link

cannot use nvm to downgrade node version #2216

Open bndia opened 4 years ago

bndia commented 4 years ago

1461 ## Operating system and version:

Windows 10 Pro Version 10.0.18363 Build 18363

nvm debug output:

```sh nvm --version: v0.35.3 $TERM_PROGRAM: Hyper $SHELL: /usr/bin/bash $SHLVL: 1 ${HOME}: /c/Users/diama ${NVM_DIR}: '${HOME}/.nvm' ${PATH}: ${HOME}/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Program Files/Java/jdk1.8.0_101/bin:/c/Program Files/nodejs:${HOME}/AppData/Local/Microsoft/WindowsApps:${HOME}/AppData/Local/atom/bin:${HOME}/AppData/Local/Microsoft/WindowsApps:${HOME}/AppData/Local/hyper/app-3.0.2/resources/bin:${HOME}/AppData/Local/Programs/Microsoft VS Code/bin:${HOME}/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl $PREFIX: '' ${NPM_CONFIG_PREFIX}: '' $NVM_NODEJS_ORG_MIRROR: '' $NVM_IOJS_ORG_MIRROR: '' shell version: 'GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)' uname -a: 'MINGW64_NT-10.0 2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys' curl: /mingw64/bin/curl, curl 7.64.0 (x86_64-w64-mingw32) libcurl/7.64.0 OpenSSL/1.1.1a (Schannel) zlib/1.2.11 libidn2/2.1.1 nghttp2/1.36.0 wget: not found git: /mingw64/bin/git, git version 2.21.0.windows.1 grep: /usr/bin/grep, grep (GNU grep) 3.1 awk: /usr/bin/awk, GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2) sed: /usr/bin/sed, sed (GNU sed) 4.7 cut: /usr/bin/cut, cut (GNU coreutils) 8.30 basename: /usr/bin/basename, basename (GNU coreutils) 8.30 rm: /usr/bin/rm, rm (GNU coreutils) 8.30 mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.30 xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0 nvm current: system which node: /c/Program Files/nodejs/node which iojs: which: no iojs in (${HOME}/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Program Files/Java/jdk1.8.0_101/bin:/c/Program Files/nodejs:${HOME}/AppData/Local/Microsoft/WindowsApps:${HOME}/AppData/Local/atom/bin:${HOME}/AppData/Local/Microsoft/WindowsApps:${HOME}/AppData/Local/hyper/app-3.0.2/resources/bin:${HOME}/AppData/Local/Programs/Microsoft VS Code/bin:${HOME}/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl) which npm: /c/Program Files/nodejs/npm npm config get prefix: C:\Users\diama\AppData\Roaming\npm npm root -g: C:\Users\diama\AppData\Roaming\npm\node_modules ```

nvm ls output:

```sh -> system iojs -> N/A (default) node -> stable (-> N/A) (default) unstable -> N/A (default) lts/* -> lts/erbium (-> N/A) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.20.1 (-> N/A) lts/erbium -> v12.16.3 (-> N/A) ```

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

What steps did you perform?

nvm install 12.6.2

What happened?

Can not determine how many core(s) are available, running in single-threaded mode. Please report an issue on GitHub to help us make nvm run faster on your computer!

```sh Local cache found: ${NVM_DIR}/.cache/src/node-v12.16.2/node-v12.16.2.tar.xz Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v12.16.2/node-v12.16.2.tar.xz $>./configure --prefix=/c/Users/diama/.nvm/versions/node/v12.16.2 < which: no python2.7 in (/c/Users/diama/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Program Files/Java/jdk1.8.0_101/bin:/c/Program Files/nodejs:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/atom/bin:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/hyper/app-3.0.2/resources/bin:/c/Users/diama/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/diama/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl) which: no python2 in (/c/Users/diama/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Program Files/Java/jdk1.8.0_101/bin:/c/Program Files/nodejs:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/atom/bin:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/hyper/app-3.0.2/resources/bin:/c/Users/diama/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/diama/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl) ./configure: line 3: /c/Users/diama/AppData/Local/Microsoft/WindowsApps/python: Permission denied ./configure: line 3: /c/Users/diama/AppData/Local/Microsoft/WindowsApps/python: Permission denied nvm: install v12.16.2 failed! ```sh

What did you expect to happen?

Downgrade the version

Is there anything in any of your profile files that modifies the PATH?

I don't think so

ljharb commented 4 years ago

@bndia can you confirm you're using WSL?

ljharb commented 4 years ago

However it looks like the issue is that you don't have python 2, which is a requirement for older versions of node (only the newest versions use python 3)

bndia commented 4 years ago

@bndia can you confirm you're using WSL?

I'm using hyper terminal

bndia commented 4 years ago

However it looks like the issue is that you don't have python 2, which is a requirement for older versions of node (only the newest versions use python 3)

I downgraded to Python 2 and now i get this message when try to downgrade node version $ nvm install 12.16.2 Can not determine how many core(s) are available, running in single-threaded mode. Please report an issue on GitHub to help us make nvm run faster on your computer! Local cache found: ${NVM_DIR}/.cache/src/node-v12.16.2/node-v12.16.2.tar.xz Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v12.16.2/node-v12.16.2.tar.xz $>./configure --prefix=/c/Users/diama/.nvm/versions/node/v12.16.2 < which: no python2.7 in (/c/Users/diama/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Program Files/Java/jdk1.8.0_101/bin:/c/Program Files/nodejs:/c/Users/diama/.windows-build-tools/python27:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/atom/bin:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/hyper/app-3.0.2/resources/bin:/c/Users/diama/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/diama/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl) which: no python2 in (/c/Users/diama/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Program Files/Java/jdk1.8.0_101/bin:/c/Program Files/nodejs:/c/Users/diama/.windows-build-tools/python27:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/atom/bin:/c/Users/diama/AppData/Local/Microsoft/WindowsApps:/c/Users/diama/AppData/Local/hyper/app-3.0.2/resources/bin:/c/Users/diama/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/diama/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl) [1mERROR: Did not find a new enough assembler, install one or build with --openssl-no-asm. Please refer to BUILDING.md nvm: install v12.16.2 failed!

ljharb commented 4 years ago

nvm requires POSIX, and on windows, i believe only WSL provides that - i have no idea what hyper terminal is.