How to check which version of v8 is installed with my NodeJS?

How is V8 installed along with NodeJs? What version is my current V8 engine?


Solution 1:

One-line solution:
node -p process.versions.v8

Alternative solution:
node -e "console.log(process.versions.v8)"

Solution 2:

Easy way:
Type in command line: node -p process.versions.v8

Hard way:

  1. Type node --version to get the Node.js version.

  2. Go to the Node.js Changelogs.

  3. Find and open an appropriate Node.js version change log.

  4. Look for notes containing V8 to.

Solution 3:

Just run npm version (don't know since when this is available)

> npm version
{ http_parser: '1.0',
  node: '0.10.35',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.30',
  zlib: '1.2.8',
  modules: '11',
  openssl: '1.0.1j',
  npm: '1.4.28',
  xsjs: '0.1.5' }

Solution 4:

To check your version, check the value in process.versions in the REPL.

node -e "console.log(process.versions.v8);"

Additionally, you can compile node with other versions of V8 if you desire. Obviously results may vary widely here depending on what versions you choose.

cd node-v0.x.x
rm -rf deps/v8
git clone http://github.com/v8/v8.git deps/v8

./configure
make
make install