Nvm: NodeJS installation issue on MSYS2

Created on 30 Oct 2018  Â·  9Comments  Â·  Source: nvm-sh/nvm

  • Operating system and version:
    Windows 10 Pro 64-bit Build: 1803

  • nvm debug output:


$ nvm debug
nvm --version: v0.33.11
$SHELL: /usr/bin/bash
$SHLVL: 1
$HOME: /home/tfbas
$NVM_DIR: '$HOME/.nvm'
$PATH: /usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
$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: 'MSYS_NT-10.0 2.11.1(0.329/5/3) 2018-09-10 14:19 x86_64 Msys'
curl: /usr/bin/curl, curl 7.61.0 (x86_64-pc-msys) libcurl/7.61.0 OpenSSL/1.0.2p zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.30.0
wget: /usr/bin/wget, GNU Wget 1.19.5 built on msys.
git: /usr/bin/git, git version 2.19.1
grep: /usr/bin/grep, grep (GNU grep) 3.1
sed: -e expression #1, char 9: Unmatched ) or )
awk: , GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.1, GNU MP 6.1.2)
sed: /usr/bin/sed, sed (GNU sed) 4.5
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
sed: -e expression #1, char 9: Unmatched ) or )
mkdir: , mkdir (GNU coreutils) 8.30
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0
nvm current: none
which node: which: no node in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/)
which iojs: which: no iojs in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/)
which npm: which: no npm in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/)
npm config get prefix: bash: npm: command not found
npm root -g: bash: npm: command not found


  • nvm ls output:

    $ nvm ls
    N/A
    node -> stable (-> N/A) (default)
    iojs -> N/A (default)
    lts/* -> lts/dubnium (-> N/A)
    lts/argon -> v4.9.1 (-> N/A)
    lts/boron -> v6.14.4 (-> N/A)
    lts/carbon -> v8.12.0 (-> N/A)
    lts/dubnium -> v10.13.0 (-> N/A)

Computing checksum with sha256sum
Checksums matched!
( NVM gets stuck here and does not proceed with installation)

  • What did you expect to happen?
    Successful installation of nodejs??
  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    .bashrc:
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This load$


- If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?


$ curl -I --compressed -v https://nodejs.org/dist/
* STATE: INIT => CONNECT handle 0x600057368; line 1429 (connection #-5000)
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x600057368; line 1465 (connection #0)
* Trying 104.20.22.46...
* TCP_NODELAY set
* STATE: WAITRESOLVE => WAITCONNECT handle 0x600057368; line 1546 (connection #0)
* Connected to nodejs.org (104.20.22.46) port 443 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x600057368; line 1598 (connection #0)
* Marked for [keep alive]: HTTP default
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /usr/ssl/certs/ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x600057368; line 1612 (connection #0)
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.nodejs.org
* start date: Aug 14 00:00:00 2017 GMT
* expire date: Nov 20 23:59:59 2019 GMT
* subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
* issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
* SSL certificate verify ok.
* STATE: PROTOCONNECT => DO handle 0x600057368; line 1633 (connection #0)
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x600057368)

HEAD /dist/ HTTP/2
Host: nodejs.org
User-Agent: curl/7.61.0
Accept: /
Accept-Encoding: deflate, gzip, br

  • STATE: DO => DO_DONE handle 0x600057368; line 1695 (connection #0)
  • multi changed, check CONNECT_PEND queue!
  • STATE: DO_DONE => WAITPERFORM handle 0x600057368; line 1822 (connection #0)
  • STATE: WAITPERFORM => PERFORM handle 0x600057368; line 1837 (connection #0)
  • Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
  • multi changed, check CONNECT_PEND queue!
  • HTTP/2 found, allow multiplexing
    < HTTP/2 200
    HTTP/2 200
    < date: Tue, 30 Oct 2018 13:27:38 GMT
    date: Tue, 30 Oct 2018 13:27:38 GMT
    < content-type: text/html
    content-type: text/html
    < set-cookie: __cfduid=deae977e10b0dd0cddc5f69068454dab31540906057; expires=Wed, 30-Oct-19 13:27:37 GMT; path=/; domain=.nodejs.org; HttpOnly
    set-cookie: __cfduid=deae977e10b0dd0cddc5f69068454dab31540906057; expires=Wed, 30-Oct-19 13:27:37 GMT; path=/; domain=.nodejs.org; HttpOnly
    < cf-cache-status: EXPIRED
    cf-cache-status: EXPIRED
    < expires: Tue, 30 Oct 2018 17:27:38 GMT
    expires: Tue, 30 Oct 2018 17:27:38 GMT
    < cache-control: public, max-age=14400
    cache-control: public, max-age=14400
    < expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    < vary: Accept-Encoding
    vary: Accept-Encoding
    < server: cloudflare
    server: cloudflare
    < cf-ray: 471e386afa858046-CPT
    cf-ray: 471e386afa858046-CPT
    < content-encoding: gzip
    content-encoding: gzip

<

  • STATE: PERFORM => DONE handle 0x600057368; line 2008 (connection #0)
  • multi_done
  • Connection #0 to host nodejs.org left intact
  • Expire cleared

windows installing node needs followup

Most helpful comment

Closing for now until I find a solution.

Seems Windows Defender since April update is causing issues with the folder protection feature, causing bash commands to fail under cygwin in msys to uncompress and write to disk. I've noticed it blocking even third party applications like games on Steam and open source applications like Krita and Blender.

Seems MSYS2's build of Arch has a special repository outside Arch, it's mainly for mingw packages. Like I've said creationix nvm has worked before under MSYS2 before without installion issue, so the culprit seems to be Windows security. I could use nvm-windows, however i'd like to keep it under my msys2 directory. Will update this once solution is found.

All 9 comments

I’m not sure what “MSYS2” is. The only way nvm currently works on windows is in WSL/BashOnWindows.

If it’s getting stuck at that part of the installation, it’s likely a bug with WSL, since others have been able to install node this way.

I’m not sure what “MSYS2” is. The only way nvm currently works on windows is in WSL/BashOnWindows.

If it’s getting stuck at that part of the installation, it’s likely a bug with WSL, since others have been able to install node this way.

Hi ljharb. MSYS2 is a Linux like subsystem for Windows, it seems to be running a custom build of Arch Linux from what I can tell. I've had success installing nvm on it before on a previous installation. I prefer using MSYS2 since it keeps all my libraries for different languages in one place.

Ah - arch linux doesn’t ship with enough stuff on it to install node. You’ll have to install some things - but I’m not sure which. nvm is actually available in AUR which i believe will address this for you.

@ljharb nvm is installed, it just fails to install node, it keeps getting stuck on the extraction of the package it seems.

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! Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler! Local cache found: $NVM_DIR/.cache/src/node-v10.13.0/node-v10.13.0.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/src/node-v10.13.0/node-v10.13.0.tar.xz

Yes, but the packages required to build node won’t be installed unless you manually installed them, or unless the AUR package does it for you.

Ok seems there is an issue with uncompressing the tar during installation, there were multiple instane of "xz data compression tool for .xz and .lzma files" running under the task manager from all the attempts to install nodejs 10. Seems there may be an issues with MSYS2's Cygwin backend. NVM has worked before for me under MSYS2 on another installation. I will continue to attempt to fix this and post my findings on success on here.

Closing for now until I find a solution.

Seems Windows Defender since April update is causing issues with the folder protection feature, causing bash commands to fail under cygwin in msys to uncompress and write to disk. I've noticed it blocking even third party applications like games on Steam and open source applications like Krita and Blender.

Seems MSYS2's build of Arch has a special repository outside Arch, it's mainly for mingw packages. Like I've said creationix nvm has worked before under MSYS2 before without installion issue, so the culprit seems to be Windows security. I could use nvm-windows, however i'd like to keep it under my msys2 directory. Will update this once solution is found.

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.14.0/node-v12.14.0.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v12.14.0/node-v12.14.0.tar.xz
$>./configure --prefix=/c/Users/user/.nvm/versions/node/v12.14.0 <
which: no python2.7 in (/c/Users/user/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/user/bin:/c/Program Files/Java/jdk1.8.0_191/bin:/c/Program Files/dotnet:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/xampp/php:/c/ProgramData/ComposerSetup/bin:/cmd:/c/Program Files/nodejs:/c/BC5/BIN:/c/Users/user/AppData/Local/Microsoft/WindowsApps:/c/Users/user/AppData/Roaming/Composer/vendor/bin:/c/Users/user/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/user/AppData/Local/GitHubDesktop/bin:/c/Windows/System32:/c/Users/user/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl)
which: no python2 in (/c/Users/user/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/user/bin:/c/Program Files/Java/jdk1.8.0_191/bin:/c/Program Files/dotnet:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/xampp/php:/c/ProgramData/ComposerSetup/bin:/cmd:/c/Program Files/nodejs:/c/BC5/BIN:/c/Users/user/AppData/Local/Microsoft/WindowsApps:/c/Users/user/AppData/Roaming/Composer/vendor/bin:/c/Users/user/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/user/AppData/Local/GitHubDesktop/bin:/c/Windows/System32:/c/Users/user/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl)
./configure: line 3: exec: python: not found
nvm: install v12.14.0 failed

python 2.7 is a requirement by node itself, so you’ll have to have that installed.

Was this page helpful?
0 / 5 - 0 ratings