reactjs - 我在创建 apk 文件博览会时遇到这种类型的错误
问题描述
我用于expo build:android
创建应用程序
Error: Can't find react-native in package.json dependencies
Error: react-native is not installed. Please run `npm install` or `yarn` in your project directory.
There is an error with your project. See above logs for information.
Error: There is an error with your project. See above logs for information.
at C:\Users\softb\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:665:15
at Command.<anonymous> (C:\Users\softb\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:346:7)
顺便说一句,我npm install react-native
是从我的默认 cmd 安装的。但是当我尝试从项目目录安装时,我得到了这个错误。
I:\Codecanyon\singal res\code>npm install react-native
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@16.13.1
npm WARN node_modules/react
npm WARN peer react@"16.13.1" from react-native@0.63.4
npm WARN node_modules/react-native
npm WARN react-native@"*" from the root project
npm WARN 1 more (@unimodules/react-native-adapter)
npm WARN 1 more (react-native-web)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"17.0.1" from react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN peer react-dom@">=16.5.1" from react-native-web@0.13.18
npm WARN node_modules/react-native-web
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@bit%2fstryber.matterhorn.loading-skeleton - Not found
npm ERR! 404
npm ERR! 404 '@bit/stryber.matterhorn.loading-skeleton@^0.0.1' 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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\softb\AppData\Local\npm-cache\_logs\2021-02-05T08_10_48_624Z-debug.log
解决方案
尝试删除node_modules
文件夹,然后重新安装依赖项npm install
还要确保expo build:android
在项目的根目录中运行命令。
推荐阅读
- docker - 在 docker 中调试镜像/生产镜像
- android - 使用 Kotlin 获取 Android 设备的总存储空间
- python - 字典中唯一嵌套值的计数
- javascript - JavaScript,“绑定”是什么意思,而不是“绑定”?document.binde.tagname...?
- javascript - 为什么 return reject() 之后的行在下面的函数中执行?
- docker - python docker镜像版本
- c# - 如何在 ASP .NET Core 中构建标识时阻止 Visual Studio 自动更新依赖项
- python - 如何根据特定字符在所述列表的第一个成员中出现的位置从列表中的每个字符串中删除一个字符?
- ios - 安装 cocoapods 并将应用程序连接到 firebase 后,“在范围内找不到 AlbumArt”。Xcode 和 SwiftUI
- python - 从列表动态创建类实例