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

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.

主站蜘蛛池模板: 永顺县| 大姚县| 南靖县| 东方市| 交口县| 琼海市| 榕江县| 保山市| 普洱| 阜宁县| 通海县| 南溪县| 那曲县| 即墨市| 历史| 韶关市| 金溪县| 来凤县| 佳木斯市| 宜春市| 科技| 新丰县| 信宜市| 邯郸县| 广水市| 洱源县| 惠来县| 保德县| 伊春市| 海原县| 和硕县| 重庆市| 兴安盟| 五家渠市| 扶风县| 宣汉县| 沛县| 岐山县| 沂源县| 南城县| 佛冈县|