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

Installing NPM

We’ll be making extensive use of the npm command-line tool and the Node.js execution environment. Each time you run your tests, which will be very frequently, you'll be required to run an npm command.

Toward the end of the chapter, we'll also use npm to package our application.

You can find out if you already have it installed on your machine by opening a Terminal window (or Command Prompt if you’re on Windows) and typing the following:

npm -v

If the command isn’t found, head on over to the Node.js website for details on how to install. The URL is included at the end of this chapter.

The npm program knows how to update itself, so if it's installed, I recommend you ensure you’re on the latest version. You can do this on the command line by typing this:

npm install npm@latest -g

I'm using version 6.9.0 to write this book. If you have any issues with the code samples contained here, differing NPM versions could be one of the causes, so please bear that in mind as you continue.


Yet another resource negotiator ( YARN) is an alternative to NPM, and I won’t hold it against you if you choose to use it. There are only a handful of npm commands in this book—I assume that if you’re sticking with YARN, then you’ll already know how to convert npm commands to yarn commands.
主站蜘蛛池模板: 辽阳市| 盐边县| 广元市| 洞口县| 盘山县| 大厂| 丘北县| 古蔺县| 汤原县| 策勒县| 正阳县| 陇川县| 栾城县| 太康县| 九寨沟县| 三原县| 富裕县| 荥经县| 莒南县| 平凉市| 扎兰屯市| 将乐县| 阜康市| 屯门区| 司法| 张家港市| 嘉荫县| 宝清县| 河西区| 府谷县| 西乡县| 阳新县| 大安市| 南投市| 巫溪县| 开封市| 邢台市| 北宁市| 云龙县| 镇平县| 集贤县|