Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-native removed when use npm install

I don't understand why my npm make that and i'm new with react-native.

Here is the description of my "bug" on Windows 10 :

I can use react-native command for run android or create react-native app like that react-native init TestApp

When i go into my app folder with cd TestApp and i run react-native link or other react-native command everythings work fine.

But if i install a new package like fbsdk with npm like that npm install react-native-fbsdk --save i saw after installation this message :

added 1 package and removed 639 packages in 22.207s

And after that, if i would like use react-native command i have this message :

Command link unrecognized. Make sure that you have run npm install and that you are inside a react-native project.

For this message, i have entered react-native link command.

You know why npm remove all my packages ?

like image 600
Shinix Avatar asked Jun 07 '17 16:06

Shinix


People also ask

How do I prevent npm install from removing packages?

Using the --no-save will tell npm not to remove the package from your package. json , npm-shrinkwrap. json , or package-lock. json files.

How do you run npm install in react-native?

You can install a particular version of the library by running npm install <library-name>@<version-number> , for example: npm install @react-native-community/netinfo@^2.0.

Can we use react-native with node js?

Hence you are right to be here. I will explain every topic with an example with minimum complexity that helps you to build a cross-platform application with a backend. ⇒ In this example , we will use React Native(for App), Node. Js(Backend API), & MongoDB(for database).


1 Answers

I got the same problem.

However I solved the problem by deleting the package-lock.json and then running npm install.

Check the answer here.

like image 57
Yeshan Jay Avatar answered Sep 24 '22 06:09

Yeshan Jay