[英]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. 我是React Native的新手,并且已经看到一些博客文章/教程使用react-native install或npm install作为依赖项。 What is the difference and what are the advantages/disadvantages between both methods?
有什么区别,两种方法的优点/缺点是什么?
react-native install xxx
is used to install a react native dependency which should be linked afterwards. react-native install xxx
用于安装应该在之后链接的react native依赖项。 You need to link only native iOS/Android dependencies. 您只需要链接本机iOS / Android依赖项。
The same thing can be achieved by running npm install xxx
and afterwards react-native link xxx
to link the library 运行
npm install xxx
,然后使用react-native link xxx
链接库,可以实现同样的目的
If you just want to install a JS only lib, you can just use npm install
如果你只想安装一个只有JS的lib,你可以使用
npm install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.