create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

'npm install react-bootstrap --save' fails

Open DaveLindberg opened this issue 10 years ago • 3 comments

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!

DaveLindberg avatar Sep 28 '16 22:09 DaveLindberg

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.

gaearon avatar Sep 28 '16 23:09 gaearon

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 .

DaveLindberg avatar Sep 29 '16 12:09 DaveLindberg

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

gaearon avatar Sep 29 '16 13:09 gaearon