react-native-ios - 将项目从 android 移动到 iOS 时出现 npm 错误?
问题描述
我正在将我的 React Native 项目从 Windows Android 转移到 MacOS for IOS。该项目由以下机构发起:
npx react-native init myproj
然后测试:
npx react-native run-ios
它与模拟器一起工作。package.json, App.js
然后我将and 组件复制到myproj
and run yarn install
。但现在run-ios
抛出关于以下的错误npm
:
npx react-narive run-ios
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/react-narive - Not found
npm ERR! 404
npm ERR! 404 'react-narive@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
试过了npx set config registry https://registry.npmjs.org/
,但没有帮助。
由于我没有npm
用于模块安装,是什么导致了错误以及如何修复?
解决方案
只需通过以下方式将 react native cli 模块更新为最新版本@react-native-community/cli
:
yarn add @react-native-community/cli
并pod install
在/ios
.
社区 cli 的当前版本是3.0.4
. 以前安装的 cli 版本2.0.1
已react-native-cli
过时。
推荐阅读
- octave - Octave中未定义的变量
- python - (已解决)rdflib:ParseException:预期 {SelectQuery | 构造查询 | 描述查询 | AskQuery},找到“s”(在字符 17 处),(行:2,列:17)
- c# - 作为另一个类成员的类始终为空
- spring - Spring MVC + Thymeleaf:不加载一些资源
- python - 处理 Flask 中的嵌套目录
- reactjs - 如何在没有 mapDispatchToProps 的情况下键入 connect
- ios - List 渲染时加载屏幕 - SwiftUI
- python - python3 pip 存在时 python2 的 pip
- php - 检查对 Laravel 控制器的异步 API 调用的响应而不返回
- python - Networkx Edge_颜色变化无常