What is the difference between react-native install vs npm install?
Asked Answered
E

2

8

I am new to React Native and have seen several blog posts/tutorials use react-native install or npm install for the dependencies. What is the difference and what are the advantages/disadvantages between both methods?

Euphemize answered 14/3, 2017 at 7:33 Comment(0)
F
12

react-native install xxx is used to install a react native dependency which should be linked afterwards. You need to link only native iOS/Android dependencies.

The same thing can be achieved by running npm install xxx and afterwards react-native link xxx to link the library

If you just want to install a JS only lib, you can just use npm install

Formate answered 14/3, 2017 at 7:43 Comment(0)
O
0

npm install

Purpose: Installs all dependencies listed in package.json.

Usage: For Node.js and React Native projects.

Command: npm install or npm install package-name

Advantages: works for any Node.js project, manages versions and dependencies effectively, Widely used.

react-native install

Purpose: Used to install and link React Native-specific dependencies.

Usage: specific to React Native projects.

Command: react-native install package-name Advantages: Simplified linking of native modules.

Oder answered 27/5 at 14:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.