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

Project initiation

The next thing we need to do is initiate our application as an npm project. Let's try it out, and then we'll discuss why we needed to do so:

  1. Inside your project folder, in your terminal, type yarn init and hit enter.
  2. It’ll ask you a series of questions. The first one is the most important--the name of our application. It should just take the name of the current folder (chatastrophe). If it doesn't, just enter chatastrophe. From there, just hit enter to skip the rest of the questions, accepting the default answers. These questions would matter more if we were planning on publishing our own package, but we're not, so no worries!
  3. If you take a look at your project folder after completing the yarn init, you'll notice that it added a package.json file with our project name and version. Our package.json is important, in that it will act as a list of our dependencies--the package we will install via yarn.

Enough talking about dependencies, though, let's install our first one! What better choice than to install React?

主站蜘蛛池模板: 建瓯市| 比如县| 北川| 四川省| 团风县| 伊吾县| 鄢陵县| 柳河县| 沁阳市| 渝中区| 红原县| 喜德县| 英德市| 阳高县| 临汾市| 深水埗区| 仪征市| 宁都县| 普格县| 登封市| 石首市| 岑巩县| 灵石县| 紫云| 习水县| 大城县| 天水市| 龙泉市| 承德市| 洛南县| 淮北市| 贺州市| 鄂托克前旗| 潼南县| 双城市| 临高县| 西乌珠穆沁旗| 大埔区| 丽水市| 浏阳市| 彰化市|