官术网_书友最值得收藏!

Verifying installation

Now that Node has been installed successfully, we can go ahead and verify that by running Node from Terminal. Inside Terminal, I'll shut it down by going to Quit Terminal and open it up again:

The reason I'm opening it up is because we've installed a new command, and some Terminals require a restart before they will be able to run that new command.

In our case, we restarted things and we can run our brand new command so, we'll type it:

node -v

What we're doing in this command is we're running the Node command, and we're passing in what's called a flag, a hyphen sign followed by a letter. It could be a, it could be j, or in our case it's v. This command will print the version of Node currently installed.

We might get an error like this:

If you try to run a command that doesn't exist, such as nodeasdf, you'll see command not found. If you see this, it usually means the Node installer didn't work correctly, or you haven't run it in the first place.

In our case though, running Node with the v flag should result in a number. In our case, it's version 9.3.0. If you do have Node installed, and you see something like the following screenshot, then you are done. In the next section, we'll start exploring exactly what Node is.

主站蜘蛛池模板: 厦门市| 渑池县| 清涧县| 永川市| 新宾| 沙雅县| 南皮县| 彰化县| 广灵县| 林甸县| 新绛县| 台东市| 乌兰察布市| 呈贡县| 南涧| 襄城县| 新宁县| 浦东新区| 阳曲县| 独山县| 昔阳县| 菏泽市| 镇江市| 会理县| 赣州市| 合水县| 衢州市| 西安市| 正蓝旗| 浦城县| 城固县| 黄石市| 兰州市| 奇台县| 平顶山市| 乐业县| 安西县| 安达市| 城步| 翁牛特旗| 布尔津县|