¿Cómo comprobar qué versión de v8 está instalada con mi NodeJS?


¿Cómo se instala V8 junto con NodeJS? ¿Qué versión es mi motor V8 actual?

 111
Author: Carter Allen, 2011-03-18

10 answers

Escriba node --version para obtener el nodo.versión js.

Luego vaya al nodo .js cambia log para calcular qué versión V8 tiene este nodo.la versión js incluye.

 100
Author: alienhard,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-01 16:59:59
node -e "console.log(process.versions.v8)"
 259
Author: Cheeso,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-11-07 04:47:52

Simplemente ejecuta npm version (no sé desde cuándo está disponible)

> 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' }
 45
Author: Peter Dotchev,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-29 11:46:56

Para comprobar su versión, compruebe el valor en process.versions en el REPL.

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

Además, puede compilar node con otras versiones de V8 si lo desea. Obviamente, los resultados pueden variar ampliamente aquí dependiendo de las versiones que elija.

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

./configure
make
make install
 30
Author: Ben Taber,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-11 17:16:42

Puedes escribir:

node -p process.versions.v8

 10
Author: Gaui,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-28 02:22:42
node -pe 'this.process.versions'     # all versions
node -pe 'this.process.versions.v8'  # v8 version
 9
Author: Vadim,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-04 14:59:12

Solo por diversión, si tienes curl disponible en tu terminal, lo siguiente debería darte la versión de v8:

V=`cat /usr/include/node/node_version.h | grep -E '^\#define NODE_(MAJOR|MINOR|PATCH)_VERSION' | sed -e 's/^[^0-9]*//'`; V=`echo $V | sed -e 's/ /\./g'`; URL=https://github.com/joyent/node/raw/v$V/ChangeLog; curl --silent $URL | grep 'Upgrade v8' | head -1 | sed -e 's/^.* //'; unset V; unset URL

Por ejemplo, en mi cuadro con nodo.js 0.4.7 Obtengo:

3.1.8.10

:)

 8
Author: Mariano Iglesias,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-05-26 23:37:32

Encuentre la versión v8 instalada con node.

$ node
> process.versions.v8
'5.1.281.83'
>

Donde El objeto process es un objeto global que proporciona información y control sobre el Nodo actual.proceso js.

Si solo escribe process en node repl, verá información sobre el nodo(es decir,versión del nodo,versión v8,plataforma, información de variables env, etc.)

 8
Author: SrmHitter9062,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-30 11:00:04

Si estás en el nodo.js versión 7.7.3 o similar el comando es

$ node -p "process.versions"

Pero los de arriba también funcionan bien.

 5
Author: Djamal Dagirov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-09-22 13:36:53

También puede comprobar cualquier versión de nodejs v8 usando docker docker run --rm -it node:10.7.0 bash -c "node -p process.versions"

 0
Author: Geng Jiawen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-23 00:48:22