How do I get the nodejs version inside a nodejs pr

2019-06-23 02:25发布

In a debugger for nodejs, there is a command to show the V8 version and the debugger package version. How can I get the nodejs version?

I imagine I can basically run a command node --version or nodejs --version, but I'm hoping there a is way to do with without running an external shell command – which is not only slower but, depending on paths, might give a different answer.

1条回答
你好瞎i
2楼-- · 2019-06-23 03:22

Use process.version to get the version of Node that is running:

console.log('Node version is: ' + process.version);
查看更多
登录 后发表回答