trying to install react-native-drawer but get errors - react-native

I'm trying to add react-native-drawer to my project.
but when I run:
npm install --save react-native-drawer
I get:
├── UNMET PEER DEPENDENCY react-native#0.41.1
└── react-native-drawer#2.3.0
npm WARN rn-drawer#1.1.3 requires a peer of react-native#^0.4.0 but none was installed.
I tried several actions people recommended like erasing my node_modules directory, or upgrading npm to the latest, or trying to install this module in a different project, but nothing helped. I can hardly believe that what is being implied here is that I simply have a version of react-native too new for this module.
my react native version is:
react-native-cli: 1.3.0
react-native: 0.41.1
my npm version is: 4.3.0
thanks!

It looks like you accidentally installed rn-drawer on your
package.json.
Just run:
npm uninstall --save rn-drawer

Related

Could not resolve react-native peer dependency

I cloned a react native repository and I am getting the following errors when I perform npm install.
It seems like 2 packages have peer dependencies with the react-native package:
react-native-async-storage/async-storage#1.17.5
react-native-svg-icon#0.10.0
The package.json file has "react-native": "0.68.2", which seems to be compatible with what react-native-async-storage package needs (react-native#"^0.0.0-0 || 0.60 - 0.68 || 1000.0.0") and same with react-native-svg-icon#0.10.0 (react-native#"^0.64.0")
I tried --force and --legacy-peer-deps commands, some vulnerabilities are solved but same output for npm install.
Any suggestions?
When running npm install:
When running npm install --legacy-peer-deps:
When running npm install --force:
What eventually worked for me was to downgrade npm's version, in my case it was 8.3.1.

ERESOLVE unable to resolve dependency tree while installing a pacakge in my expo account

I have existing project, I update my SDK Version from 41 to 44 by following these steps.
1)Update to the latest version of Expo CLI: npm i -g expo-cli. expo-cli#5.4.3 or greater is required.
2)Run expo upgrade in your project directory.
After that I run expo start but got this error
Unable to find expo in this project - have you run yarn / npm install yet?
Than I try to run npm install and getting this error
ERESOLVE unable to resolve dependency tree while installing a pacakge
[enter image description here][1]
I am using Mac
[1]: https://i.stack.imgur.com/D6hhN.png
When you updated your SDK, it looks like npm could not resolve the dependency: #react-native-community/masked-view
You can try to run: npm uninstall #react-native-community/masked-view and then re-try npm install.
What may make things easier is to just give your dependency tree a good ol' refresh.
Delete node_modules and package-lock.json
re-run npm install in the ROOT of your project.
Triple check you are in the correct spot when running these commands.

Where and How should I add AsyncStorage with React Native 0.59?

I just upgraded to react-native 0.59.0-rc.3 and I'm getting a warning about AsyncStorage that will be removed from react-native and added to #react-native-community/async-storage.
But in the #react-native-community/async-storage it only says how to link it, but not how to install it
e.g npm install some_package
Where Should I install it from?
npm install react-native-community and just import it from that?
npm install #react-native-community/async-storage?
As it states on the repo
# Install
$ yarn add #react-native-community/async-storage
Usually if a dependency is available with yarn it is available with npm
However, if you are using npm instead of yarn you can install it with
npm i #react-native-community/async-storage
yarn and npm are both package managers. Choose one and stick with it.
To see if a package is available for npm you can search on https://www.npmjs.com
As you can see from the below link that it is on npm and can be installed using npm i.
https://www.npmjs.com/package/#react-native-community/async-storage
The NPM package is #react-native-community/async-storage.
Have a look at the NPM page for it

npm does not install new package after modifying package.json

I have a web application with some packages defined in package.json after I run npm install all dependencies are resolved. However when I add some packages after that to package.json and run npm install again nothing happens. I did the work around by typing npm install --save lodash and it downloaded the dependency and updated packages.json. It works, but let's imagine the scenario when I want to add 10 or more packages. Then it would be easier for me to just add them to package.json and run npm install but this does not work :/. So what would be the solution for the problem off adding more packages after initial npm install?
Node version: v8.1.3
npm version: 5.03
Operating System: Windows 10 Pro

npm packages installed from command line not appearing in packages.json dependencies for React-Native project

I have a React-Native project and I'm trying to install certain npm modules in my project.
However, when I try to do so from the command line, the packages says it is installed correctly, but it is not appearing in the packages.json dependency.
For instance, I installed react-relay using npm install react-relay.
The package looks to have installed correctly. But I check my packages.json and react-relay is not in there.
I have tried react-native link, and the packages are not coming up.
What is going on?
you would need to use the "save" option: npm install react-relay --save
You need to add save option
npm install react-relay --save
or
npm i react-relay --s
To remove node module from package.json file
npm uninstall react-relay --save
Here is documentation for npm install