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

n latest gives Error: invalid version #517

Closed
dhegglin opened this issue Jul 7, 2018 · 16 comments
Closed

n latest gives Error: invalid version #517

dhegglin opened this issue Jul 7, 2018 · 16 comments

Comments

@dhegglin
Copy link

dhegglin commented Jul 7, 2018

Issue Template:

Describe issue including what OS you are using

docker
root@642b8f51967f:/# uname -a
Linux 642b8f51967f 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64 GNU/Linux

Describe what version of N you have

root@642b8f51967f:/# n --version
2.1.12

Describe how you installed N

RUN npm install --verbose -g n

Steps to reproduce issue 1.2.3

root@642b8f51967f:/# n

Error: no installed version

Describe the results you received

root@642b8f51967f:/# n 7.1.2

 install : node-v7.1.2

Error: invalid version 7.1.2

Describe the results you expected

install and use version 7.1.2

What version of npm you are using

root@642b8f51967f:/# npm --version
6.1.0

Additional information you deem important (e.g. issue happens only occasionally):

root@642b8f51967f:/# which n
/usr/bin/n
root@642b8f51967f:/# node -v
v10.6.0
root@642b8f51967f:/# curl --version
curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
root@642b8f51967f:/# which curl
/usr/bin/curl
root@642b8f51967f:/# ls -l /usr/local/n/versions
total 0
drwxr-sr-x. 2 root staff 6 Jul 7 15:18 io
drwxr-sr-x. 2 root staff 6 Jul 7 15:18 node
root@642b8f51967f:/# ls -l /usr/local/n/versions/node
total 0
root@642b8f51967f:/# ls -l /usr/local/n/versions/io
total 0

(paste your output here)

@shadowspawn
Copy link
Collaborator

  1. The first message was because n with no parameters shows you the list of downloaded versions, and you did not have any yet.

Error: no installed version

  1. The second error is because there was no release of node with version number 7.1.2.

Error: invalid version 7.1.2

https://nodejs.org/en/download/releases/

(You could try n lts to take the version number out of the equation.)

@dhegglin
Copy link
Author

dhegglin commented Jul 9, 2018

root@242d9dedbea0:/# n lts

Error: invalid version

root@242d9dedbea0:/# n latest

Error: invalid version

@shadowspawn
Copy link
Collaborator

Ok, still have a problem!
Is it a public base docker image, so I can try reproducing?
Does curl https://nodejs.org/dist/get the html page with the list of versions?

@dhegglin
Copy link
Author

dhegglin commented Jul 9, 2018

I have an issue with https (proxy issue). Only http works:

root@f58cdde2b2d5:/# curl https://nodejs.org/dist/
^C
root@f58cdde2b2d5:/# curl http://nodejs.org/dist/

<title>Index of /dist/</title>

Index of /dist/


../
latest/                                            04-Jul-2018 18:08                   -
latest-argon/                                      30-Mar-2018 03:32                   -
latest-boron/                                      12-Jun-2018 23:26                   -
latest-carbon/                                     12-Jun-2018 23:26                   -

@shadowspawn
Copy link
Collaborator

Issues #430 talks about setting HTTP_PROXY and HTTPS_PROXY. This is used by curl with some details in this stack overflow topic.

Otherwise there is an environment variable to override the node mirror, but then of course you are using http and not https. Can try with a one-off command like:

NODE_MIRROR=http://nodejs.org/dist/ n --lts

@dhegglin
Copy link
Author

nice, that works!

root@703ee01208b7:/# NODE_MIRROR=http://nodejs.org/dist/ n --lts
8.11.3

root@703ee01208b7:/# NODE_MIRROR=http://nodejs.org/dist/ n 7.2.1

 install : node-v7.2.1
   mkdir : /usr/local/n/versions/node/7.2.1
   fetch : http://nodejs.org/dist/v7.2.1/node-v7.2.1-linux-x64.tar.gz

######################################################################## 100.0%
installed : v7.2.1

@GerroDen
Copy link

GerroDen commented Oct 16, 2018

The env NODE_MIRROR also worked for me.
But after a bit digging i found out, that my curl did not support https somehow(?).
curl -V did not contain the https protocol.
So i compiled it with the correct support for my platform: https://askubuntu.com/questions/475670/how-to-build-curl-with-the-latest-openssl, https://curl.haxx.se/docs/install.html
I used the default openssl package for my platform (Ubuntu 16.04) and these commands made it work:

sudo apt install libssl-dev
./configure --with-ssl --with-libssl-prefix=/usr/local/ssl
make
sudo make install

@chengjaun
Copy link

But it doesn't work for me, what can i do?
root@localhost:# NODE_MIRROR=http://nodejs.org/dist/ n --lts
10.13.0
root@localhost:
# NODE_MIRROR=http://nodejs.org/dist/ n 10.13.0

 install : node-v10.13.0

Error: invalid version 10.13.0

root@localhost:~#

@shadowspawn
Copy link
Collaborator

@chengjaun

  1. Do you know if you are behind a proxy? This thread turned out to be about proxy issues. One way to check is run a curl command directly so can see the errors if it is blocked:

curl https://nodejs.org/dist/

  1. What architecture are you on? Please post the results of uname -a which is how n finds out.

@chengjaun
Copy link

Thanks for your answer, I have removed the node of old version and installed one of version number 8.11.1

Now I want to run this cmd:
npm install --save @google/earthengine

but it give me this:
npm WARN root@1.0.0 No description
npm WARN root@1.0.0 No repository field.

Do you have such a problem?
My machine is
root@localhost:~# uname -a
Linux localhost 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:27:09 UTC 2017 i686 i686 i686 GNU/Linux

@shadowspawn
Copy link
Collaborator

Those two warnings are normal when installing into a new npm module just created by npm init. npm is warning that those fields in the package.json have not been supplied yet. They do not indicate a problem with npm or node (or n).

Are you still having problems with n?

@chengjaun
Copy link

Thanks for your help, there is no problems now.

@shadowspawn
Copy link
Collaborator

An explanation for people getting "invalid version" for lts or latest, but able to install node 8 and below.

n uses the pre-built binaries from nodejs, and 32-bit builds for Linux were dropped for node 10. If unname -a shows i686 then this probably affects you.

nodejs/build#885

Node 8 is still being supported, and a convenience for installing the newest version is:

n 8

@shadowspawn
Copy link
Collaborator

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

@edgardojs
Copy link

I am getting this exact same issue on an Ubuntu Virtual Machine. I tried curl and it is not proxy related. My uname -a outputs 686 because I donot want to install or need to use 64bit.

@shadowspawn
Copy link
Collaborator

@edgardojs
See #517 (comment)

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

No branches or pull requests

5 participants