繁体   English   中英

为什么我在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 

那应该解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM