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

查看:12
本文介绍了命令行上的 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? (i.e. not the REPL)

推荐答案

命令行是:

node -v

node --version

注意:

如果 node -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天全站免登陆