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

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.
主站蜘蛛池模板: 永和县| 壤塘县| 扬州市| 阿克苏市| 榆树市| 武义县| 乾安县| 泽普县| 沙雅县| 聂拉木县| 达州市| 潜江市| 绥滨县| 九龙县| 江山市| 麦盖提县| 喀喇| 梁平县| 缙云县| 中江县| 舟山市| 靖边县| 会理县| 宁安市| 平顶山市| 广丰县| 疏勒县| 江西省| 罗江县| 莫力| 荣成市| 滁州市| 桃江县| 桑植县| 浏阳市| 苍梧县| 吴堡县| 甘谷县| 红桥区| 沁水县| 图片|