mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
'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:
@@ -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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user