在运行时获取node.js版本


73

我与旧版本的node.js存在兼容性问题。

有什么方法可以在运行时获取node.js版本吗?

Answers:


117
> process.version
'v0.6.8'
> process.versions
{ node: '0.6.8',
  v8: '3.6.6.19',
  ares: '1.7.5-DEV',
  uv: '0.6',
  openssl: '0.9.8g' }
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.