[英]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附图显示错误
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
。
Follow the step over here to install asdf
.按照此处的步骤安装
asdf
。 Make sure to add them to the config file (in your case, .zshrc
).确保将它们添加到配置文件(在您的情况下为
.zshrc
)。
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 ).在此之前,请确保您具有所需的依赖项( 检查此处)。
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 ).同样,确保安装所需的依赖项(检查此处)。
Install the required version using asdf install <plugin> <version>
, eg:使用
asdf install <plugin> <version>
安装所需的版本,例如:
$ asdf install ruby 3.1.1
After installing, you may want to run asdf reshim
.安装后,您可能需要运行
asdf reshim
。
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
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.