简体   繁体   English

使用Yarn或NPM进行本机反应找不到@ expo / bunyan。 我该怎么办?

[英]React native with Yarn or NPM is not finding @expo/bunyan. What I have to do?

I tried to create an application with React Native, when I use the command create-react-native-app the library @expo/bunyan is not found. 我尝试使用React Native创建一个应用程序,当我使用命令create-react-native-app时,找不到库@ expo / bunyan。 I tried to clean the npm cache, changing the npm registry, but I still have the error. 我试图清理npm缓存,更改了npm注册表,但是仍然出现错误。 That is the log. 那是日志。

Arguments:
  /usr/local/bin/node /usr/local/Cellar/yarn/1.5.1_1/libexec/bin/yarn.js add --dev --exact --ignore-optio$

PATH:
  /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Frameworks/Mono.framework/Versi$

Yarn version:
  1.5.1

Node version:
  8.10.0

Platform:
  darwin x64

npm manifest:
  {
    "name": "Tes",
    "version": "0.1.0",
    "private": true
  }

yarn manifest:
  No manifest

Lockfile:
  No lockfile

Trace:
  Error: Couldn't find package "@expo/bunyan@1.8.10" required by "react-native-scripts" on the "npm" regi$
      at new MessageError (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:186:110)
      at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:36274:17)
      at Generator.throw (<anonymous>)
      at step (/usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:98:30)
      at /usr/local/Cellar/yarn/1.5.1_1/libexec/lib/cli.js:111:13
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

The create-react-native-app does not support npm5 currently because npm5 is buggy. 由于npm5有问题,因此create-react-native-app目前不支持npm5 you can use npm4 or latest npm stable version available. 您可以使用npm4或最新的npm稳定版本。

I have tried to install create-react-native-app library on my system having the following configuration: 我尝试在具有以下配置的系统上安装create-react-native-app库:

node -v 节点-v

v9.4.0 v9.4.0

npm -v npm -v

5.6.0 5.6.0

Before installation once remove the node_modules and clear the npm-cache . 在安装之前,请先删除node_modules并清除npm-cache

Set npm registry using npm config set registry http://registry.npmjs.org/ command. 使用npm config set registry http://registry.npmjs.org/命令设置npm注册表。

Then try to install using npm i react-native-scripts --save --use-npm --verbose command. 然后尝试使用npm i react-native-scripts --save --use-npm --verbose命令进行安装。

If you want to install the same library using yarn then you can use yarn global add create-react-native-app command for the same. 如果要使用yarn安装相同的库,则可以使用yarn global add create-react-native-app命令。

Hope this will help you! 希望这个能对您有所帮助!

暂无
暂无

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

相关问题 安装 node、react-native、npm 和 expo 做你的桌面有什么好处? [等候接听] - What are the benefits of installing node, react-native, npm and expo do your desktop when you can just code in expo snack? [on hold] LogRotate Bunyan。 每1分钟旋转一次以进行测试 - LogRotate Bunyan. rotate every 1 minute for testing 反应 expo cli npm 错误的本机安装 - react native installation of expo cli npm error 如何在 Expo 客户端上打开 React Native 应用程序? - How do I open a React Native Application on Expo Client? 我可以将 React Native 应用程序从 Yarn 无缝切换到 NPM 还是它更复杂? - Can I switch React Native app from Yarn to NPM seamlessly or is it more involved? 在这个项目中找不到 expo - 你运行 yarn / npm 安装了吗? Npm已经安装,expo目录存在 - Unable to find expo in this project - have you run yarn / npm install yet? Npm has been installed, expo directory exists React native 或 expo - 你知道一种即使应用程序已死或尚未打开也能推送通知的方法吗? - React native or expo - do you know a way to push a notification even when the app is dead or have not been opened? 如何使用纱线正确安装 expo-cli? - How do I properly install expo-cli with yarn? 我不能同时使用 npm 和纱线启动带有反应脚本的服务器? - I can not start a server with react scripts using both npm and yarn? 我有哪个版本的[在此处插入npm模块]? - What version of [insert npm module here] do I have?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM