Error Installing React - reactjs

Whenever I do a npm init then npm install react - I get this error
── UNMET PEER DEPENDENCY react#15.3.0
npm WARN baobab-react#0.1.1 requires a peer of react#>=0.13.0 <1.0.0 but none was installed.
npm WARN fixed-data-table#0.4.7 requires a
peer of react#>=0.13.0 <0.15.0 || ^0.14.0-beta3 but none was
installed.
npm WARN react-native#0.30.0 requires a peer of
react#~15.2.0 but none was installed.
npm WARN react-router#0.13.5
requires a peer of react#0.13.x||0.14.x but none was installed. npm
ERR! code 1
This is my node v6.3.0 annd npm 3.10.3 versions.

npm install react --no-optional

Inside your project directory, can you please first run the following commands:-
1) rm -rf node_modules
2) Try installig react again now and other packages which are in your package.json file.

Related

npm add react-icons installation does not work

I am new to React and I try to download react-icons, but there is an error, which is different from those I had found here. Can you help, please?
(base) Jana-MacBook-Air:react_project jb$ npm install react-icons --save
Response:
npm WARN saveError ENOENT: no such file or directory, open '/Users/jb/Desktop/react_project/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/jb/Desktop/react_project/package.json'
npm WARN react-icons#4.1.0 requires a peer of react#* but none is installed. You must install peer dependencies yourself.
npm WARN react_project No description
npm WARN react_project No repository field.
npm WARN react_project No README data
npm WARN react_project No license field.
+ react-icons#4.1.0
updated 1 package and audited 1 package in 1.875s
found 0 vulnerabilities
Well, do you have a package.json file in your root path of the project? The error is because that package have a peer dependency with react and because it's not finding the package.json file, then for the npm installation process, react it's not installed.

React-webcam not getting added to my react project

I did the following to install react-webcam,
sudo npm install -g --save react-webcam
npm WARN react-webcam#3.0.1 requires a peer of react#>=15.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-webcam#3.0.1 requires a peer of react-dom#>=15.3.0 but none is installed. You must install peer dependencies yourself.
+ react-webcam#3.0.1
added 1 package from 1 contributor in 0.351s
but it wasnt added to the dependencies in package.json, So how can I add it to the node modules?

Warnings about peer dependencies when running npm install

I'm trying to update my React/Firebase project with
npm install --save firebase-functions#latest
and I get a lot of warnings:
npm WARN google-maps-react#2.0.0 requires a peer of react#~0.14.8 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN google-maps-react#2.0.0 requires a peer of react-dom#~0.14.8 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN firebase-functions#1.0.1 requires a peer of firebase-admin#~5.12.0 but none is installed. You must install peer dependencies yourself.
I'm a newbie so not sure which command should I run to fix the warnings.
Install it by hand:
With npm 5.0.0 or above (edited):
npm install react#^16.0.0
npm install react-dom#^16.0.0
npm install firebase-admin#~5.12.0
npm install firebase-functions#latest
Before npm 5.0.0 (original):
npm install --save react#^16.0.0
npm install --save react-dom#^16.0.0
npm install --save firebase-admin#~5.12.0
npm install --save firebase-functions#latest

[react-native]npm install warn require multiple version react

I'm running a react-native project,and it's package.json dependencies some third-part libraries,but maybe these libraries haven't update for a long time,they require different version of react.
When I npm install, I got warning below:
npm WARN react-native#0.43.3 requires a peer of react#16.0.0-alpha.6 but none was installed.
npm WARN native-base-shoutem-theme#0.1.0 requires a peer of react#>=15.1.0 but none was installed.
npm WARN #shoutem/animation#0.8.10 requires a peer of react#^15.0.0 but none was installed.
npm WARN react-static-container#1.0.1 requires a peer of react#^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN react-test-renderer#15.4.2 requires a peer of react#^15.4.2 but none was installed.
I'm not sure npm could install multiple version in a single project.So how could I fix this problem?

Error when trying npm install tslint and rxjs

I've tried npm install tslint and npm install rxjs, both run after npm cache clean and with #latest in the end. Every time I keep getting "UNMET PEER DEPENDECY rxjs#5.0.3" and "UNMET PEER DEPENDENCY tslint#4.3.1".
The entire failure stack is
[jannik#jannik-dimsen app (AngularApp *)]$ npm install
first-app#0.0.0 /home/jannik/angular2apps/first-app
├── UNMET PEER DEPENDENCY rxjs#5.0.3
└── UNMET PEER DEPENDENCY tslint#4.3.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.17: wanted {"os":"darwin","
arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN #angular/core#2.2.3 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
npm WARN #angular/http#2.2.3 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
npm WARN #angular/router#3.2.3 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
npm WARN codelyzer#2.0.0-beta.3 requires a peer of tslint#~4.0.0 but none was installed.
npm WARN tslint-loader#2.1.5 requires a peer of tslint#^3.0.0 but none was installed.
npm ERR! code 1
Some sites suggested running npm cache clean but that didn't fix my problem, and I can't figure out why I can't install those npm modules. I've added them to the package.json file as well and tried a npm install giving the same error

Resources