Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 261
chemook78 Avatar asked Mar 14 '17 07:03

chemook78


People also ask

What is the difference between npm and install?

npm I is the short version of npm install so that part of the command does not differ at all either. And there is does say “ npm install saves any specified packages into dependencies by default.”

Can you use npm in react-native?

React Native libraries are typically installed from the npm registry using a Node. js package manager such as npm CLI or Yarn Classic. If you have Node.

What is npm react-native?

React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform. Declarative. React makes it painless to create interactive UIs.

What is the difference between react and React Native?

When comparing React vs React Native another thing to look at is the differences in styling. React is being used in the DOM and has full access to CSS or CSS in js. On the other hand, React Native had to create its own version of styling.

Is React Native a cross platform framework?

Q. Is react native hybrid or native? React Native is neither native nor hybrid. Rather, it is a cross-platform framework. That implies, it develops applications that run both on Android and iOS platforms.

Why should you hire a React Native App Development Company?

To use those inaccessible APIs, React Native relies on the idea to add native module support which requires that the React Native app development company you hire knows how to code in both the native languages.

Why is my NPM install not installing the correct version?

If you use ^ or ~ when you specify the version of your dependency, npm may not install the exact version you specified. npm install can update your package-lock.json when there are changes such as when you install a new dependency. It will delete your node_modules folder to ensure a clean state.


1 Answers

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

like image 133
Tobias Lins Avatar answered Oct 31 '22 22:10

Tobias Lins