Shinix
Shinix

Reputation: 184

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 ?

Upvotes: 7

Views: 3389

Answers (2)

Fabio
Fabio

Reputation: 2824

I also noticed recently that npm install doesn't do what I expect, but that may be because I'm newbie.

However yarn install is a good replacement and is working fine for me. I used it to upgrade/downgrade things by directly editing packages.json, and it also solved the npm link problem that I faced.

Edit: downgrading to npm 7 solved all my issues

Upvotes: 0

Yeshan Jay
Yeshan Jay

Reputation: 1413

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.

Upvotes: 3

Related Questions