Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cygwin? #1393

Closed
abcfy2 opened this issue Feb 8, 2017 · 9 comments
Closed

Support cygwin? #1393

abcfy2 opened this issue Feb 8, 2017 · 9 comments

Comments

@abcfy2
Copy link

abcfy2 commented Feb 8, 2017

  • Operating system and version:
    windows 10

  • nvm debug output:

nvm --version: v0.33.0
$SHELL: /bin/bash
$HOME: /home/abcfy
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: none
which node: which: no node in ($HOME/.sdkman/candidates/maven/current/bin:$HOME/.sdkman/candidates/groovy/current/bin:$HOME/.sdkman/candidates/grails/current/bin:$HOME/.sdkman/candidates/gradle/current/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/cygdrive/c/Users/abcfy/AppData/Local/Microsoft/WindowsApps)
which iojs: which: no iojs in ($HOME/.sdkman/candidates/maven/current/bin:$HOME/.sdkman/candidates/groovy/current/bin:$HOME/.sdkman/candidates/grails/current/bin:$HOME/.sdkman/candidates/gradle/current/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/cygdrive/c/Users/abcfy/AppData/Local/Microsoft/WindowsApps)
which npm: which: no npm in ($HOME/.sdkman/candidates/maven/current/bin:$HOME/.sdkman/candidates/groovy/current/bin:$HOME/.sdkman/candidates/grails/current/bin:$HOME/.sdkman/candidates/gradle/current/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/cygdrive/c/Users/abcfy/AppData/Local/Microsoft/WindowsApps)
npm config get prefix: -bash: npm: command not found
npm root -g: -bash: npm: command not found
  • nvm ls output:
            N/A
node -> stable (-> N/A) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.7.3 (-> N/A)
lts/boron -> v6.9.5 (-> N/A)
  • How did you install nvm? (e.g. install script in readme, homebrew):
    install script in readme

  • What steps did you perform?
    nvm install --lts

  • What happened?

Installing latest LTS version.
Local cache found: $NVM_DIR/.cache/src/node-v6.9.5/node-v6.9.5.tar.xz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/src/node-v6.9.5/node-v6.9.5.tar.xz

... SNIP ...

/usr/bin/python tools/gyp_node.py -f make
gyp: name 'MSVS_VERSION' is not defined while evaluating condition '(OS=="win" and MSVS_VERSION>="2012") or llvm_version>="3.3" or xcode_version>="5.0" or gas_version>="2.23"' in /home/abcfy/.nvm/.cache/src/node-v6.9.5/files/deps/openssl/openssl.gyp
make: *** [Makefile:76: out/Makefile] Error 1
nvm: install v6.9.5 failed!

I've tried many times, and I've already installed msvs 2015, gcc, and llvm but no help.

Maybe we could download windows pre-built binary from https://nodejs.org/dist/v6.9.5/node-v6.9.5-win-x64.7z ?

@ljharb
Copy link
Member

ljharb commented Feb 8, 2017

nvm supports POSIX only. While BashOnWindows is POSIX-compliant, I don't believe cygwin is or ever plans to be.

If BashOnWindows isn't an option, the readme lists Windows alternatives.

@thoni56
Copy link

thoni56 commented Jan 30, 2018

Just for clarity, cygwin is not windows. It attempts to provide a substantial POSIX API functionality. Don't know how "fully" it needs to be for nvm, nor how "fully" they are striving for.

But the support is extensive enough to compile a host of programs almost out of the box.

Not bashing, just came here by looking specifically for nvm on cygwin.

And it seemed to be no problem installing nvm using the curl-command in the readme.

@ljharb
Copy link
Member

ljharb commented Jan 30, 2018

Theoretically nvm works on anything POSIX-compliant, but i don’t think node offers that same guarantee.

@DanKaplanSES
Copy link

DanKaplanSES commented Jul 19, 2024

The documentation says nvm works on Cygwin. Should this issue be reopened (or recreated, I don't know if the documentation said this at the time of issue creation)? Either way, I've been able to get node to run fine in Cygwin: it's possible this is issue is caused within the nvm source.

@ljharb
Copy link
Member

ljharb commented Jul 19, 2024

@DanKaplanSES in 2018, nvm did not support cygwin. now, it does.

@manminusone
Copy link

There appears to be a reliance on curl for Cygwin installs. Without the command line tool installed I get an error when attempting to install:

$  nvm install --lts
Installing latest LTS version.
Downloading and installing node v20.16.0...
Downloading https://nodejs.org/dist/v20.16.0/node-v20.16.0-win-x64.zip...
Warning: Failed to open the file
Warning: /home/james/.nvm/.cache/bin/node-v20.16.0-win-x64/node-v20.16.0-win-x6
Warning: 4.zip: No such file or directory
curl: (23) client returned ERROR on write of 3610 bytes

Binary download from https://nodejs.org/dist/v20.16.0/node-v20.16.0-win-x64.zip failed, trying source.
grep: /home/james/.nvm/.cache/bin/node-v20.16.0-win-x64/node-v20.16.0-win-x64.zip: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Installing from source on non-WSL Windows is not supported)

Installing curl resolves the issue. Is the reliance on curl documented, or is it just assumed that it's installed?

@ljharb
Copy link
Member

ljharb commented Aug 19, 2024

curl: (23) client returned ERROR on write of 3610 bytes

this means curl is installed, altho perhaps it’s picking up on a windows installation of it?

Yea, the readme documents that curl or wget is required.

@manminusone
Copy link

manminusone commented Aug 19, 2024

My problem appears when only wget is installed in the Cygwin environment. There appears to be a Windows curl executable located at C:\Windows\System32\curl.exe, and that's the one that nvm is apparently using.

ETA: This appears to be part of Windows 11.

@ljharb
Copy link
Member

ljharb commented Aug 19, 2024

Thanks; I believe that's very similar to #3393 and might be already filed as #3391.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants