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

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.
主站蜘蛛池模板: 鹰潭市| 吉首市| 德兴市| 长治市| 西充县| 阜阳市| 象州县| 滦平县| 石台县| 冷水江市| 通城县| 昌乐县| 无为县| 虹口区| 湖北省| 平果县| 博白县| 车致| 丹凤县| 两当县| 香港| 莱州市| 黄梅县| 舒城县| 沐川县| 北海市| 罗定市| 木兰县| 六枝特区| 胶南市| 苏尼特左旗| 浑源县| 佛冈县| 金阳县| 临江市| 营山县| 禄劝| 建德市| 平山县| 阿荣旗| 张家港市|