如何检查我的NodeJS安装了哪个版本的v8 ?

时间:2022-12-03 19:28:47

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

V8是如何与NodeJs一起安装的?我现在的V8引擎是什么版本?

9 个解决方案

#1


95  

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

类型节点——获取节点的版本。js版本。

Then go to the node.js changes log to figure which V8 version this node.js version includes.

然后到节点。js将日志更改为该节点的V8版本。包括js版本。

#2


246  

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

#3


43  

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

只运行npm版本(不知道何时可用)

> 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' }

#4


30  

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

要检查您的版本,请检查进程中的值。在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.

此外,如果您愿意,可以使用其他版本的V8编译node。显然,根据您选择的版本,结果可能会有很大的不同。

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

./configure
make
make install

#5


8  

Just for fun, if you have curl available in your terminal, the following should give you v8's version:

只是为了好玩,如果你的终端有curl,下面应该给你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

For example, in my box with node.js 0.4.7 I get:

例如,在我的盒子里有节点。js 0.4.7得到:

3.1.8.10

:)

:)

#6


8  

node -pe 'this.process.versions'     # all versions
node -pe 'this.process.versions.v8'  # v8 version

#7


8  

You can just type:

你可以类型:

node -p process.versions.v8

节点- p process.versions.v8

#8


6  

find the installed v8 version with node.

使用节点查找安装的v8版本。

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

where The process object is a global that provides information about, and control over, the current Node.js process.

进程对象是一个全局变量,它提供关于当前节点的信息和控制。js的过程。

if you just type process in node repl, you see information about node(i.e. node version,v8 version,platform,env variables info etc.)

如果您只是在node repl中键入流程,则会看到有关节点的信息(例如:节点版本,v8版本,平台,env变量信息等。

#9


4  

If you're on Node.js version 7.7.3 or similar the command is

如果你在节点。js版本7.7.3或类似的命令是。

$ node -p "process.versions"

But those above work fine too.

但以上这些工作也很好。

#1


95  

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

类型节点——获取节点的版本。js版本。

Then go to the node.js changes log to figure which V8 version this node.js version includes.

然后到节点。js将日志更改为该节点的V8版本。包括js版本。

#2


246  

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

#3


43  

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

只运行npm版本(不知道何时可用)

> 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' }

#4


30  

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

要检查您的版本,请检查进程中的值。在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.

此外,如果您愿意,可以使用其他版本的V8编译node。显然,根据您选择的版本,结果可能会有很大的不同。

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

./configure
make
make install

#5


8  

Just for fun, if you have curl available in your terminal, the following should give you v8's version:

只是为了好玩,如果你的终端有curl,下面应该给你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

For example, in my box with node.js 0.4.7 I get:

例如,在我的盒子里有节点。js 0.4.7得到:

3.1.8.10

:)

:)

#6


8  

node -pe 'this.process.versions'     # all versions
node -pe 'this.process.versions.v8'  # v8 version

#7


8  

You can just type:

你可以类型:

node -p process.versions.v8

节点- p process.versions.v8

#8


6  

find the installed v8 version with node.

使用节点查找安装的v8版本。

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

where The process object is a global that provides information about, and control over, the current Node.js process.

进程对象是一个全局变量,它提供关于当前节点的信息和控制。js的过程。

if you just type process in node repl, you see information about node(i.e. node version,v8 version,platform,env variables info etc.)

如果您只是在node repl中键入流程,则会看到有关节点的信息(例如:节点版本,v8版本,平台,env变量信息等。

#9


4  

If you're on Node.js version 7.7.3 or similar the command is

如果你在节点。js版本7.7.3或类似的命令是。

$ node -p "process.versions"

But those above work fine too.

但以上这些工作也很好。