【问题标题】:I am getting this type of error while creating apk file expo我在创建 apk 文件博览会时遇到这种类型的错误
【发布时间】:2021-02-05 17:36:14
【问题描述】:

我使用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)

顺便说一句,我从我的默认 cmd 安装了npm install react-native。但是当我尝试从项目目录安装时,我得到了这个错误。

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

【问题讨论】:

标签: reactjs react-native


【解决方案1】:

尝试删除node_modules文件夹,然后用npm install重新安装依赖项

还要确保在项目的根目录中运行 expo build:android 命令。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-30
    • 2023-01-30
    • 1970-01-01
    • 2020-04-21
    • 2017-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多