V8はNodeJと一緒にどのようにインストールされますか?現在のV8エンジンはどのバージョンですか?
12 に答える
1 行のソリューション:
node -p process.versions.v8
代替ソリューション:
node -e "console.log(process.versions.v8)"
簡単な方法:
コマンドラインで入力します:node -p process.versions.v8
難しい方法:
入力
node --version
してNode.jsのバージョンを取得します。Node.js変更ログに移動します。
適切なNode.jsバージョン変更ログを見つけて開きます。
を含むメモを探します
V8 to
。
バージョンを確認するにprocess.versions
は、REPL の値を確認します。
node -e "console.log(process.versions.v8);"
さらに、必要に応じて、V8 の他のバージョンでノードをコンパイルできます。明らかに、選択したバージョンに応じて、ここでの結果は大きく異なる場合があります。
cd node-v0.x.x
rm -rf deps/v8
git clone http://github.com/v8/v8.git deps/v8
./configure
make
make install
次のように入力するだけです。
node -p process.versions.v8
ターミナルで 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
たとえば、node.js 0.4.7 を含む私のボックスでは、次のようになります。
3.1.8.10
:)
Node.js バージョン 7.7.3 または同様のものを使用している場合、コマンドは次のとおりです。
$ node -p "process.versions"
しかし、上記のものもうまくいきます。
node -pe 'this.process.versions' # all versions
node -pe 'this.process.versions.v8' # v8 version
他の回答は、現在のバージョンを確認するのに最適です。すべての Node.js バージョンの表もここにあります: https://nodejs.org/en/download/releases/。例の抜粋:
Version Date V8 npm NODE_MODULE_VERSION
Node.js 11.0.0 2018-10-23 7.0.276.28 6.4.1 67
Node.js 10.13.0 2018-10-30 6.8.275.32 6.4.1 64
Node.js 10.12.0 2018-10-10 6.8.275.32 6.4.1 64