Node.js版本在命令行上? (不是REPL) [英] Node.js version on the command line? (not the REPL)

查看:148
本文介绍了Node.js版本在命令行上? (不是REPL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在命令行上获取node.js的版本 - 我希望运行一个命令:

I want to get the version of node.js on the command line - I'm expecting to run a command like:

node -version

但不起作用。有人知道命令行是什么吗? (即不是REPL)

but that doesn't work. Does anybody know what the command line would be? (ie not the REPL)

推荐答案

命令行是:

node -v

node --version

注意:

如果节点-v 不起作用,但 nodejs - v ,那么在您的系统上没有正确设置的东西。有关解决问题的方法,请参见此其他问题

If node -v doesn't work, but nodejs -v does, then something's not set up quite right on your system. See this other question for ways to fix it.

这篇关于Node.js版本在命令行上? (不是REPL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆