process.version
process.version 属性包含 Node.js 版本字符串。
console.log(`Version: ${process.version}`);
// Version: v14.8.0要获取不带 v 的版本字符串,则使用 process.versions.node。
The process.version property contains the Node.js version string.
console.log(`Version: ${process.version}`);
// Version: v14.8.0To get the version string without the prepended v, use
process.versions.node.