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

nvm install returns curl: (22) The requested URL returned error: 404 #2667

Closed
ozgurbaserdem opened this issue Nov 29, 2021 · 5 comments
Closed
Labels
installing node Issues with installing node/io.js versions. OS: Mac OS

Comments

@ozgurbaserdem
Copy link

ozgurbaserdem commented Nov 29, 2021

Operating system and version:

macOS Monterey version 12.0.1
MacBook Pro, M1 Pro chip.

nvm debug output:

nvm --version: v0.39.0
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'ozgur'
${HOME}: /Users/ozgur
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v17.1.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.8 (x86_64-apple-darwin21.0)'
uname -a: 'Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64'
checksum binary: 'shasum'
OS version: macOS 12.0.1 21A559
curl: /usr/bin/curl, curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
wget: not found
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/bin/git, git version 2.30.1 (Apple Git-130)
grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
awk: /usr/bin/awk, awk version 20200816
nvm current: v17.1.0
which node: ${NVM_DIR}/versions/node/v17.1.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v17.1.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v17.1.0
npm root -g: ${NVM_DIR}/versions/node/v17.1.0/lib/node_modules

nvm ls output:

->      v17.1.0
default -> node (-> v17.1.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v17.1.0) (default)
stable -> 17.1 (-> v17.1.0) (default)
lts/* -> lts/gallium (-> 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.24.1 (-> N/A)
lts/erbium -> v12.22.7 (-> N/A)
lts/fermium -> v14.18.1 (-> N/A)
lts/gallium -> v16.13.0 (-> N/A)

How did you install nvm?

I installed it using the curl script

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

What steps did you perform?

First I used nvm install node, then nvm use node. After this I checked my node version using node -v and it said v17.1.0. So far so good.

What happened?

Then I tried to use nvm install 14.16.1 but got the error: curl: (22) The requested URL returned error: 404

This is how it looked, and after the last line it went bananas and pretty much into what looked like an endless loop of lots of text about configuration stuff (or smth).

Downloading and installing node v14.16.1...
Downloading https://nodejs.org/dist/v14.16.1/node-v14.16.1-darwin-arm64.tar.xz...
curl: (22) The requested URL returned error: 404                                                             

Binary download from https://nodejs.org/dist/v14.16.1/node-v14.16.1-darwin-arm64.tar.xz failed, trying source.
grep: /Users/ozgur/.nvm/.cache/bin/node-v14.16.1-darwin-arm64/node-v14.16.1-darwin-arm64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Local cache found: ${NVM_DIR}/.cache/src/node-v14.16.1/node-v14.16.1.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v14.16.1/node-v14.16.1.tar.xz
$>./configure --prefix=/Users/ozgur/.nvm/versions/node/v14.16.1 <
Node.js configure: Found Python 3.8.9...
INFO: configure completed successfully

What did you expect to happen?

I expected the 14.16.1 version to be installed. I installed nvm on my old macbook air laptop earlier today and it seemed to work flawlessly so I don't understand what mistake I did now running the installation again. Could it be the M1 chip that is the issue?

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

Not sure, but I don't think so.

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

*   Trying 104.20.22.46:443...
* Connected to nodejs.org (104.20.22.46) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* 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, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.nodejs.org
*  start date: Oct 21 00:00:00 2019 GMT
*  expire date: Jan 18 23:59:59 2022 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* 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 0x13e010600)
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> user-agent: curl/7.77.0
> accept: */*
> accept-encoding: deflate, gzip
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 200 
HTTP/2 200 
< date: Mon, 29 Nov 2021 21:47:42 GMT
date: Mon, 29 Nov 2021 21:47:42 GMT
< content-type: text/html
content-type: text/html
< last-modified: Mon, 29 Nov 2021 18:15:06 GMT
last-modified: Mon, 29 Nov 2021 18:15:06 GMT
< cache-control: max-age=14400
cache-control: max-age=14400
< cf-cache-status: HIT
cf-cache-status: HIT
< 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: 6b5f0934c805cb08-ARN
cf-ray: 6b5f0934c805cb08-ARN
< content-encoding: gzip
content-encoding: gzip

< 
* Connection #0 to host nodejs.org left intact
@ljharb
Copy link
Member

ljharb commented Nov 29, 2021

node doesn't support M1 Macs earlier than v16, except via Rosetta.

See the relevant readme section.

@ljharb ljharb closed this as completed Nov 29, 2021
@ljharb ljharb added installing node Issues with installing node/io.js versions. OS: Mac OS labels Nov 29, 2021
@ozgurbaserdem
Copy link
Author

Thank you, I just realized this.

@sourabhbit
Copy link

Switch the processor architecture to emulate the old Intel chips

arch -x86_64 zsh

Install whatever version of the node binaries you need

nvm install 12.18.3

@joelcipriano
Copy link

Switch the processor architecture to emulate the old Intel chips

arch -x86_64 zsh

Install whatever version of the node binaries you need

nvm install 12.18.3

What is the command to revert the architecture change? Is it necessary to do this? Thanks!

@Muhammad-Zain01
Copy link

Switch the processor architecture to emulate the old Intel chips

arch -x86_64 zsh

Install whatever version of the node binaries you need

nvm install 12.18.3

What is the command to revert the architecture change? Is it necessary to do this? Thanks!

Command to Shift to arm
arch -arm64 zsh

for checking your current architecture
arch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. OS: Mac OS
Projects
None yet
Development

No branches or pull requests

5 participants