Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find NODE_MODULE_VERSION?

Is it possible to know NODE_MODULE_VERSION in Node.js? If yes, then how? I am interested specifically in the VSCode's builtin Node.js, but maybe Node.js doesn't expose the variable, but VSCode API does?

like image 703
Nurbol Alpysbayev Avatar asked Jul 16 '26 02:07

Nurbol Alpysbayev


1 Answers

To access in node what electron refers to as NODE_MODULE_VERSION, you use:

process.versions.modules


Other values in that object:

> console.log(process.versions)
{
  "http_parser": "2.8.0",
  "node": "8.16.2",
  "v8": "6.2.414.78",
  "uv": "1.23.2",
  "zlib": "1.2.11",
  "ares": "1.10.1-DEV",
  "modules": "57",
  "nghttp2": "1.39.2",
  "napi": "4",
  "openssl": "1.0.2s",
  "icu": "60.1",
  "unicode": "10.0",
  "cldr": "32.0",
  "tz": "2017c"
}
like image 83
Lawrence Cherone Avatar answered Jul 17 '26 21:07

Lawrence Cherone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!