'npm init' needed before installing react via npm. (#8649)

* 'npm init' needed before installing react via npm.

I was trying to install react in my django project directory and was getting warnings about package.json not being present. Started this SO post (http://stackoverflow.com/questions/41340909/npm-cant-find-package-json-when-installing-react/41340975#41340975) to figure it out. I think it'll be useful to others too if we add it in the documentation itself.

* Tweak instructions
This commit is contained in:
gitanupam
2016-12-28 17:34:21 +05:30
committed by Dan Abramov
parent b186e3c87e
commit 7807354bfd
+2
View File
@@ -52,12 +52,14 @@ We recommend using [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/)
To install React with Yarn, run:
```bash
yarn init
yarn add react react-dom
```
To install React with npm, run:
```bash
npm init
npm install --save react react-dom
```