我是React Native的新手,并且已经看到一些博客文章/教程使用react-native install或npm install作为依赖项 . 有什么区别,两种方法的优点/缺点是什么?
react-native install xxx 用于安装应该在之后链接的react native依赖项 . 您只需要链接本机iOS / Android依赖项 .
react-native install xxx
通过运行 npm install xxx 和之后的 react-native link xxx 来链接库,可以实现同样的目的
npm install xxx
react-native link xxx
如果你只想安装一个只有JS的库,你可以只使用 npm install
npm install
1 回答
react-native install xxx
用于安装应该在之后链接的react native依赖项 . 您只需要链接本机iOS / Android依赖项 .通过运行
npm install xxx
和之后的react-native link xxx
来链接库,可以实现同样的目的如果你只想安装一个只有JS的库,你可以只使用
npm install