简体   繁体   English

npx react-native init 在安装 Bundler 时失败

[英]npx react-native init fails on Installing Bundler

I have been trying to create a new react-native app with the command npx react-native init SamepleApp but it fails on Installing Bundler with the following issue我一直在尝试使用命令npx react-native init SamepleApp创建一个新的 react-native 应用程序,但它在安装 Bundler 时失败并出现以下问题

Attached Image showing error附图显示错误

1个

I tried updating my ruby version to the latest version but it also did not help.我尝试将我的 ruby 版本更新到最新版本,但它也没有帮助。 I have been using MacBook Pro 2017 with Intel Chip and my ruby version is 2.6.10p210, Node version is v16.17.1 and no react-native-CLI is globally installed我一直在使用带有英特尔芯片的 MacBook Pro 2017,我的 ruby 版本是 2.6.10p210,Node 版本是 v16.17.1,并且没有全局安装 react-native-CLI

I am trying to figure out a solution to a problem.我正在尝试找出问题的解决方案。

Not a Mac user, but you may be able to make use of asdf-vm .不是 Mac 用户,但您可以使用asdf-vm

  1. Follow the step over here to install asdf .按照此处的步骤安装asdf Make sure to add them to the config file (in your case, .zshrc ).确保将它们添加到配置文件(在您的情况下为.zshrc )。

  2. Head over to asdf-ruby and install the Ruby plugin.前往asdf-ruby并安装 Ruby 插件。 Before that, make sure that you have the required dependencies ( check here ).在此之前,请确保您具有所需的依赖项( 检查此处)。

  3. Optionally, you may also choose to install asdf-nodejs and follow the steps below for the same.或者,您也可以选择安装asdf-nodejs并按照以下步骤进行操作。 Again, make sure to install the required dependencies ( check here ).同样,确保安装所需的依赖项(检查此处)。

  4. Install the required version using asdf install <plugin> <version> , eg:使用asdf install <plugin> <version>安装所需的版本,例如:

     $ asdf install ruby 3.1.1
  5. After installing, you may want to run asdf reshim .安装后,您可能需要运行asdf reshim

  6. To set the plugin version globally, run asdf global <plugin> <version> , eg:要全局设置插件版本,请运行asdf global <plugin> <version> ,例如:

     $ asdf global ruby 3.1.1

    OR要么

    To set the version locally (that is, for a particular directory), run asdf local <plugin> <version> , eg:要在本地设置版本(即针对特定目录),请运行asdf local <plugin> <version> ,例如:

     $ asdf local ruby 3.1.1
  7. Check all the version installed using asdf list .使用asdf list检查所有安装的版本。 Check your active versions using asdf current .使用asdf current检查您的活动版本。

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

相关问题 npx react-native init 什么都不做 - npx react-native init does nothing 运行`npx react-native init 的问题<NAME> - issues running `npx react-native init <NAME> 无法运行 npx react-native init MyApp - can not run npx react-native init MyApp npx react-native init AwesomeProject 错误 enolocal - npx react-native init AwesomeProject error enolocal npx react-native init MyProject:“错误:命令失败:yarn add react-native@latest” - npx react-native init MyProject: "Error: Command failed: yarn add react-native@latest" 无法在 react native CLI 中运行 npx react-native init MyApp - can not run npx react-native init MyApp in react native CLI npx react-native init MainApp Giving 错误(代码:'MODULE_NOT_FOUND',)。 这里有什么问题 - npx react-native init MainApp Giving error (code: 'MODULE_NOT_FOUND',) . What's the isue here npx react-native init AwesomeProject 失败并出现错误“node:internal/modules/cjs/loader:372 throw err;” - npx react-native init AwesomeProject Failed with Error" node:internal/modules/cjs/loader:372 throw err;" npx react-native init 错误在 appdata 文件夹中不包含 package.json 文件 - npx react-native init error does not contain a package.json file in appdata folder 安装:本机初始化失败-明显的网络问题 - Installation: react-native init fails - Apparent network issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM