From 7807354bfd2eb954d049bfcda500396fc150899f Mon Sep 17 00:00:00 2001 From: gitanupam Date: Wed, 28 Dec 2016 17:34:21 +0530 Subject: [PATCH] '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 --- docs/docs/installation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 0f15296476..a3f3f1b792 100644 --- a/docs/docs/installation.md +++ b/docs/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 ```