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

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?

主站蜘蛛池模板: 万盛区| 都匀市| 宁德市| 尉犁县| 临漳县| 阿城市| 克山县| 吐鲁番市| 台中市| 彭州市| 平阴县| 安平县| 西宁市| 德保县| 广德县| 双江| 眉山市| 伊川县| 左云县| 宿松县| 积石山| 淮南市| 龙门县| 勐海县| 克东县| 凤台县| 乐安县| 个旧市| 克山县| 巴林左旗| 永安市| 漠河县| 东丰县| 朝阳市| 吉林市| 都昌县| 溆浦县| 隆林| 怀远县| 临夏县| 贵定县|