为什么我不能在我的 react-native 项目中使用 npm 安装 native-base?

Why i can't install native-base with npm in my react-native project?

npm install native-base --save

我有这个错误:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ENETUNREACH: request to https://registry.npmjs.org/react-native-keyboard-aware-scroll-view failed, reason: connect ENETUNREACH 104.16.22.35:443
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! path /Users/.../node_modules/react-native-safe-area-view
npm ERR! code EISGIT

npm ERR! git /Users/.../node_modules/react-native-safe-area-view: Appears to be a git repo or submodule.
npm ERR! git     /Users/.../node_modules/react-native-safe-area-view
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/.../.npm/_logs/2019-05-14T10_13_00_776Z-debug.log

此问题有时会发生,作为临时解决方案,请按照以下步骤操作:

  1. 删除node_modules目录下的这个文件夹

    C:\Users\...\node_modules\react-native-safe
        -area-view
    
  2. 重新安装您要添加的包。

    npm install native-base --save
    

这应该可以解决问题。