Create-react-app: 'npm install react-bootstrap --save' fails

Created on 29 Sep 2016  Β·  3Comments  Β·  Source: facebook/create-react-app

If you are reporting a bug, please fill in below. Otherwise feel to remove this template entirely.

Description

Following the tutorial to install react-bootstrap, npm install react-bootstrap --save produces the following results:

/Users/dlindberg/Projects/React/create-react-app
β”œβ”€β”€ UNMET PEER DEPENDENCY react@>=0.14.0
β”œβ”€β”¬ [email protected]
β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ β”œβ”€β”€ [email protected]
β”‚ β”‚ └── [email protected]
β”‚ β”œβ”€β”€ [email protected]
β”‚ β”œβ”€β”€ [email protected]
β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ └─┬ [email protected]
β”‚ β”‚   └── [email protected]
β”‚ β”œβ”€β”€ [email protected]
β”‚ β”œβ”€β”€ UNMET PEER DEPENDENCY react@>=0.14.0
β”‚ β”œβ”€β”€ UNMET PEER DEPENDENCY react-dom@>=0.14.0
β”‚ β”œβ”€β”¬ [email protected]
β”‚ β”‚ └── UNMET PEER DEPENDENCY react@>=0.14.0
β”‚ β”œβ”€β”€ [email protected]
β”‚ β”œβ”€β”€ [email protected]
β”‚ └── [email protected]
└── UNMET PEER DEPENDENCY react-dom@>=0.14.0

npm WARN [email protected] requires a peer of react@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react@>=0.11.0 but none was installed.
npm WARN [email protected] requires a peer of react@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@>=0.14.0 but none was installed.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
/Users/dlindberg/Projects/React/create-react-app
β”œβ”€β”€ UNMET PEER DEPENDENCY react@>=0.14.0
└── UNMET PEER DEPENDENCY react-dom@>=0.14.0

npm ERR! peer dep missing: react@>=0.14.0, required by [email protected]
npm ERR! peer dep missing: react-dom@>=0.14.0, required by [email protected]
npm ERR! code 1
  1. node -v: v4.5.0
  2. npm -v: 3.10.8

Then, specify:

  1. Operating system: Mac OS 10.11.06 El Cap
  2. Browser and version: Chrome Version 53.0.2785.116 (64-bit)

Reproducible Demo

See new app that reproduces the issue. Pushed to GitHub and pasted the link here.

https://github.com/DaveLindberg/test-react-bootstrap

Demonstrable issues get fixed faster. Thanks!

proposal

Most helpful comment

I can’t reproduce this on your project.
The error message says:

npm WARN [email protected] requires a peer of react@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@>=0.14.0 but none was installed.

This means that react and react-dom for some reason aren’t installed in your project folder even though they are listed in package.json. My guess is that their installation failed for some reason earlier, and so they are missing in your node_modules.

Can you please try:

  1. Delete node_modules in your project
  2. Run npm install
  3. Try npm install --save react-bootstrap again

and report the results?

Thanks.

All 3 comments

I can’t reproduce this on your project.
The error message says:

npm WARN [email protected] requires a peer of react@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@>=0.14.0 but none was installed.

This means that react and react-dom for some reason aren’t installed in your project folder even though they are listed in package.json. My guess is that their installation failed for some reason earlier, and so they are missing in your node_modules.

Can you please try:

  1. Delete node_modules in your project
  2. Run npm install
  3. Try npm install --save react-bootstrap again

and report the results?

Thanks.

Thanks for the response.

I completed the 3 steps outlined, and the issue is now resolved. After
deleting node_modules, npm install successfully added react and react-dom.

Running npm install bootstrap@3 --save and npm install bootstrap@3 --save was
successful.

:-)

Dave Lindberg Marketing & Design
802.282.3368 | DaveLindberg.com | twitter: @DaveLindberg
https://twitter.com/DaveLindberg | linkedin: in/DaveLindberg
https://www.linkedin.com/in/davelindberg

On Wed, Sep 28, 2016 at 7:45 PM, Dan Abramov [email protected]
wrote:

I can’t reproduce this on your project.
The error message says:

npm WARN [email protected] requires a peer of react@>=0.14.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@>=0.14.0 but none was installed.

This means that react and react-dom for some reason aren’t installed in
your project folder even though they are listed in package.json. My guess
is that their installation failed for some reason earlier, and so they are
missing in your node_modules.

Can you please try:

  1. Delete node_modules in your project
  2. Run npm install
  3. Try npm install --save react-bootstrap again

and report the results?

Thanks

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/facebookincubator/create-react-app/issues/792#issuecomment-250333552,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcsVNmm2_NuVahBuwSa9bStqRIuEBGKks5quvwJgaJpZM4KJXkE
.

I’ll close this then. Glad the issue is resolved!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rdamian3 picture rdamian3  Β·  3Comments

callumlocke picture callumlocke  Β·  3Comments

AlexeyRyashencev picture AlexeyRyashencev  Β·  3Comments

barcher picture barcher  Β·  3Comments

Aranir picture Aranir  Β·  3Comments