Nodejs version can be checked by using node -v, but how can I check the latest version available in nodejs using npm?? Using JavaScript I can access the nodejs version by using "process.version". Is there a way to check the latest version of nodejs available using JavaScript.
Asked
Active
Viewed 321 times
-2
-
3Answered here: https://stackoverflow.com/questions/11949419/nodejs-npm-show-latest-version-of-a-module – caweeks May 25 '17 at 19:40
-
1Possible duplicate of [Nodejs npm show latest version of a module](https://stackoverflow.com/questions/11949419/nodejs-npm-show-latest-version-of-a-module) – Eduard Malakhov May 25 '17 at 19:46
-
That would work for checking via npm, any idea about JS? – Shashank May 25 '17 at 19:56
1 Answers
0
You would have to do something like parsing the list of Node downloads (https://nodejs.org/dist/) and extracting the highest version number.
Do note though that if they change their URL structure or something (unlikely for something as established as Node.js, but possible), it would break.
The running instance of Node itself wouldn't have any inherent way to know what other versions are out there.

samanime
- 25,408
- 15
- 90
- 139