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

"Warning: Failed to create the file: No such file or directory" on Cygwin #2353

Closed
hashimaziz1 opened this issue Nov 19, 2020 · 6 comments
Closed
Labels
non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated. OS: windows

Comments

@hashimaziz1
Copy link

hashimaziz1 commented Nov 19, 2020

Operating system and version: Cygwin on Windows 10

nvm debug output:

nvm --version: v0.37.0
$TERM_PROGRAM: mintty
$SHELL: /bin/bash
$SHLVL: 1
whoami: 'Hashim'
${HOME}: /home/Hashim
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: /cygdrive/c/xampp/php:/usr/sbin:/cygdrive/c/xampp/php:/usr/sbin:/usr/local/bin:/usr/bin:/cygdrive/c/Python38/Scripts:/cygdrive/c/Python38:/cygdrive/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/Microsoft VS Code/bin:/cygdrive/c/Android:/cygdrive/c/Program Files/dart:/cygdrive/c/Program Files/Amazon/AWSCLIV2:/cygdrive/c/Program Files/nodejs:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/d/Users/Hashim/AppData/Local/Microsoft/WindowsApps:/cygdrive/d/Users/Hashim/AppData/Roaming/npm
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)'
uname -a: 'CYGWIN_NT-10.0 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin'
checksum binary: 'sha256sum'
curl: /cygdrive/c/WINDOWS/system32/curl, curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
wget: /usr/bin/wget, GNU Wget 1.19.1 built on cygwin.
git: /usr/bin/git, git version 2.28.0
grep: /usr/bin/grep, grep (GNU grep) 3.0
awk: /usr/bin/awk, GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.0)
sed: /usr/bin/sed, sed (GNU sed) 4.4
cut: /usr/bin/cut, cut (GNU coreutils) 8.26
basename: /usr/bin/basename, basename (GNU coreutils) 8.26
rm: /usr/bin/rm, rm (GNU coreutils) 8.26
mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.26
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0
nvm current: system
which node: /cygdrive/c/Program Files/nodejs/node
which iojs: which: no iojs in (/cygdrive/c/xampp/php:/usr/sbin:/cygdrive/c/xampp/php:/usr/sbin:/usr/local/bin:/usr/bin:/cygdrive/c/Python38/Scripts:/cygdrive/c/Python38:/cygdrive/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/Microsoft VS Code/bin:/cygdrive/c/Android:/cygdrive/c/Program Files/dart:/cygdrive/c/Program Files/Amazon/AWSCLIV2:/cygdrive/c/Program Files/nodejs:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/d/Users/Hashim/AppData/Local/Microsoft/WindowsApps:/cygdrive/d/Users/Hashim/AppData/Roaming/npm)
which npm: /cygdrive/c/Program Files/nodejs/npm
npm config get prefix: D:\Users\Hashim\AppData\Roaming\npm
npm root -g: D:\Users\Hashim\AppData\Roaming\npm\node_modules

nvm ls output:

$ nvm ls
->       system
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)
lts/* -> lts/fermium (-> 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.23.0 (-> N/A)
lts/erbium -> v12.19.1 (-> N/A)
lts/fermium -> v14.15.1 (-> N/A)

How did you install nvm?

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

What steps did you perform?

I need Node JS 10 in order to use Foundation for a web project. I tried to do nvm install 10 to install and switch to v10 instead of my current v12.

What happened?

I got the following output:

Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Downloading https://nodejs.org/dist/v10.23.0/node-v10.23.0.tar.xz...
Warning: Failed to create the file
Warning: /home/Hashim/.nvm/.cache/src/node-v10.23.0/node-v10.23.0.tar.xz: No
Warning: such file or directory

curl: (23) Failed writing body (0 != 719)
Binary download from https://nodejs.org/dist/v10.23.0/node-v10.23.0.tar.xz failed, trying source.
grep: /home/Hashim/.nvm/.cache/src/node-v10.23.0/node-v10.23.0.tar.xz: No such file or directory
Provided file to checksum does not exist.

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

PATH="/usr/sbin:$PATH"
PATH="/cygdrive/c/xampp/php:$PATH"
@ljharb
Copy link
Member

ljharb commented Nov 20, 2020

nvm does not support cygwin- it requires a POSIX shell, which on windows is only WSL.

@ljharb ljharb closed this as completed Nov 20, 2020
@ljharb ljharb added non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated. OS: windows labels Nov 20, 2020
@redwards101
Copy link

nvm does not support cygwin- it requires a POSIX shell, which on windows is only WSL.

Actually, this isn't my experience. It works fine with Cygwin and Msys2.
This failure was likely caused by not having wget or curl installed. nvm.sh isn't good at reporting that.

@ljharb
Copy link
Member

ljharb commented Dec 7, 2021

That’s because the latest version is the first one to support those environments; at the time, nvm didn’t work there at all.

@redwards101
Copy link

Ah, thanks. That explains it. I had been using it on msys2 and I thought it was much longer ago.

@hashimaziz1
Copy link
Author

hashimaziz1 commented Dec 7, 2021

That’s because the latest version is the first one to support those environments; at the time, nvm didn’t work there at all.

Would it be possible to link the patch that fixed this behaviour, or at least the file(s)? I've run into this before with other open source projects and it would be useful to have more information to either fix them or help the maintainers do so.

@ljharb
Copy link
Member

ljharb commented Dec 7, 2021

@Kaos-Industries #2391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated. OS: windows
Projects
None yet
Development

No branches or pull requests

3 participants