hokaccha / nodebrew

Node.js version manager
MIT License
1.06k stars 66 forks source link

curl fetch problem (can't install) #70

Closed jnst closed 6 years ago

jnst commented 6 years ago

My environment here.

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.5
BuildVersion:   17F77

$ nodebrew
nodebrew 0.9.6

I can't install from install-binary and install command.

$ nodebrew install-binary v10
v10.5.0 is not found

Can not fetch: https://nodejs.org/dist/v10.5.0/node-v10.5.0-darwin-x64.tar.gz
$ nodebrew install v10
v10.5.0 is not found

Can not fetch: https://nodejs.org/dist/v10.5.0/node-v10.5.0.tar.gz
Can not fetch: https://nodejs.org/dist/node-v10.5.0.tar.gz

Is this code correct? curl result does not contain 'OK'. https://github.com/hokaccha/nodebrew/blob/master/nodebrew#L877

$ curl -LIs https://nodejs.org/dist/v10.5.0/node-v10.5.0-darwin-x64.tar.gz

HTTP/2 200
date: Fri, 22 Jun 2018 09:53:20 GMT
content-type: application/gzip
content-length: 16185492
set-cookie: __cfduid=d3c9b4f4f99bd5fdc743effa44e4b40e01529661199; expires=Sat, 22-Jun-19 09:53:19 GMT; path=/; domain=.nodejs.org; HttpOnly
last-modified: Wed, 20 Jun 2018 17:40:35 GMT
etag: "5b2a9193-f6f894"
accept-ranges: bytes
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 42edd3c15e37a5d2-NRT
jnst commented 6 years ago

I tried install latest curl from Homebrew.

curl 7.54.0 (my Mac default)

HTTP/2 200 - Not contains 'OK'

$ curl -V

curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy
$ curl -LIs https://nodejs.org/dist/v10.5.0/node-v10.5.0-darwin-x64.tar.gz

HTTP/2 200
date: Fri, 22 Jun 2018 10:12:32 GMT
content-type: application/gzip
content-length: 16185492
set-cookie: __cfduid=d0dace2fe91d9fab4e342b52918d969d31529662351; expires=Sat, 22-Jun-19 10:12:31 GMT; path=/; domain=.nodejs.org; HttpOnly
last-modified: Wed, 20 Jun 2018 17:40:35 GMT
etag: "5b2a9193-f6f894"
accept-ranges: bytes
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 42edefe2fe57a5f0-NRT

curl 7.60.0 (insatlled from homebrew)

HTTP/1.1 200 OK - Contains 'OK'

$ curl -V

curl 7.60.0 (x86_64-apple-darwin17.5.0) libcurl/7.60.0 SecureTransport zlib/1.2.11
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
$ curl -LIs https://nodejs.org/dist/v10.5.0/node-v10.5.0-darwin-x64.tar.gz

HTTP/1.1 200 OK 
Date: Fri, 22 Jun 2018 10:10:43 GMT
Content-Type: application/gzip
Content-Length: 16185492
Connection: keep-alive
Set-Cookie: __cfduid=dd2e56bb16d31ab31ea31198178599fc01529662243; expires=Sat, 22-Jun-19 10:10:43 GMT; path=/; domain=.nodejs.org; HttpOnly
Last-Modified: Wed, 20 Jun 2018 17:40:35 GMT
ETag: "5b2a9193-f6f894"
Accept-Ranges: bytes
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 42eded3acf56951d-NRT
jnst commented 6 years ago

Please fix this. I think that it does not need 'OK'. https://github.com/hokaccha/nodebrew/blob/master/nodebrew#L877

I fixed file directry.

$ vi /Users/jnst/.nodebrew/current/bin/nodebrew

then it works.

$ nodebrew install-binary v10
Fetching: https://nodejs.org/dist/v10.5.0/node-v10.5.0-darwin-x64.tar.gz
######################################################################## 100.0%
Installed successfully
jnst commented 6 years ago

The reason was that I used the link of the old nodebrew (0.9.6) I'm sorry for confused you. This issue done.