Browse Source

'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
main
gitanupam 8 years ago
committed by Dan Abramov
parent
commit
864a2c76b8
  1. 2
      docs/installation.md

2
docs/installation.md

@ -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
```

Loading…
Cancel
Save