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

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?

主站蜘蛛池模板: 娄烦县| 资阳市| 临潭县| 方山县| 泰州市| 曲阳县| 鄂托克旗| 临城县| 漠河县| 昌平区| 南江县| 萍乡市| 广宗县| 海南省| 绿春县| 育儿| 四会市| 浮山县| 伊金霍洛旗| 克山县| 屏边| 壤塘县| 西充县| 蕲春县| 昭苏县| 海盐县| 德安县| 万源市| 城固县| 疏勒县| 黔东| 榆社县| 讷河市| 湘西| 且末县| 龙口市| 宜春市| 梅河口市| 衡东县| 灵宝市| 峡江县|