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

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.
主站蜘蛛池模板: 梓潼县| 财经| 海门市| 大荔县| 简阳市| 县级市| 高密市| 百色市| 绵竹市| 郁南县| 全州县| 铜陵市| 义乌市| 军事| 安顺市| 武汉市| 醴陵市| 华阴市| 临夏市| 桃园县| 三门县| 于田县| 平阳县| 阿图什市| 建瓯市| 铁岭县| 邳州市| 土默特左旗| 英吉沙县| 闸北区| 绥阳县| 冷水江市| 青岛市| 佛坪县| 蒙山县| 巨鹿县| 江源县| 苏州市| 敦化市| 启东市| 兴国县|