Nodejs version: Difference between revisions

From wikinotes
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Documentation =
<blockquote>
{| class="wikitable"
|-
| versions chart || https://nodejs.org/en/download/releases/
|-
|}
</blockquote><!-- Documentation -->
= NodeJS Build Versioning =
= NodeJS Build Versioning =
<blockquote>
<blockquote>
Line 9: Line 18:
| V8 version || the chromium javascript engine version built into this nodejs version
| V8 version || the chromium javascript engine version built into this nodejs version
|-
|-
| <code>NODE_MODULE_VERSION</code> || C extensions built in node are built to a node_module.<br> I think this might be a C runtime.<br> This is generally stable for a wide range of nodejs versions.
| <code>NODE_MODULE_VERSION</code> || C extensions built in node are built using a specific target node module version.<br> I think this might be a C runtime.<br> This is generally stable for a wide range of nodejs versions.
|-
|-
|}
|}


You can see nodejs version info [https://nodejs.org/en/download/releases/ here].
See this [https://nodejs.org/en/download/releases/ version-info chart].
</blockquote><!-- NodeJS Build Versioning -->
</blockquote><!-- NodeJS Build Versioning -->


= NodeJS info =
= Managing Node Versions =
<blockquote>
<blockquote>
You can use [[nvm]] to manage node versions.
<syntaxhighlight lang="bash">
nvm run 16.0.3 node foo.js  # run nodejs -v 16.0.3
</syntaxhighlight>
</blockquote><!-- Managing Node Versions -->
= Accessing Version Info =
<blockquote>
<syntaxhighlight lang="bash">
node -v  # nodejs version
</syntaxhighlight>
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
const process = require('process');
const process = require('process');

Latest revision as of 23:18, 14 December 2021

Documentation

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

NodeJS Build Versioning

node.js version release of nodejs you are using
npm version npm is installed with nodejs, but versioned separately
V8 version the chromium javascript engine version built into this nodejs version
NODE_MODULE_VERSION C extensions built in node are built using a specific target node module version.
I think this might be a C runtime.
This is generally stable for a wide range of nodejs versions.

See this version-info chart.

Managing Node Versions

You can use nvm to manage node versions.

nvm run 16.0.3 node foo.js  # run nodejs -v 16.0.3

Accessing Version Info

node -v  # nodejs version
const process = require('process');

process.version  // 'v10.1.1'