Command `run-android` unrecognized. Make sure that you have run `npm install` and that you are insid

本文记录了在安装React Native过程中遇到的“Command `run-android` unrecognized”错误,并分享了解决这一问题的具体步骤,包括检查npm install命令、验证开发环境配置及重装Python和Node等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

记录一下安装react-native报错:

开发环境搭建参考这篇:

https://reactnative.cn/docs/0.36/getting-started.html

按照上面写的到这一步

React Native命令行工具(react-native-cli)

之后因为Android Studio已经安装了,所以直接跳过,不过还是看看有什么没有装或必须的。还真有,

React Native目前需要Android Studio2.0或更高版本。

Android Studio需要Java Development Kit [JDK] 1.8或更高版本。

  • SDK Platforms窗口中,选择Show Package Details,然后在Android 6.0 (Marshmallow)中勾选Google APIsIntel x86 Atom System ImageIntel x86 Atom_64 System Image以及Google APIs Intel x86 Atom_64 System Image
  • SDK Tools窗口中,选择Show Package Details,然后在Android SDK Build Tools中勾选Android SDK Build-Tools 23.0.1。(必须是这个版本)

做完后,那些推荐安装什么的就都没装,直接到测试安装了。

这时问题来了,在执行react-native run-android 命令时报错了

Command `run-android` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.

经过理解后,就是命令`run-android`无法辨认,确认你已经执行`npm install` 命令了吗?还有就是你是进入项目文件夹

里面执行的命令吗?

cd AwesomeProject

上面那句就是已经进入项目文件夹中了,所以我就又执行了`npm install` 命令然后才执行react-native run-android 但是还是这个错误,各种查找,Google上都看了,最后无奈。。。

我就重新去官网上下载

Python 2  
Node

然后安装,再执行react-native run-android,啊哈,应该可以了,开心不过两秒,又有错误发生


上面圈着的我也是看半懂吧,觉得是我的JDK的问题,于是上网找,结果有很多和我类似的问题,但是没有和我一样的问题

于是我就想到之前重装,好吧这次我也重装试试看。啊哈,还真让我给解决了。虽然不知道是什么原因,但是总算解决了。

手机上跑一下看看,好吧,我的RN之旅就此开始吧。(我只想搞原生的)


usage: control_robot.py [-h] [--config_path str] [--robot str] [--robot.type {aloha,koch,koch_bimanual,moss,so101,so100,stretch,lekiwi}] [--robot.gripper_open_degree str] [--robot.max_relative_target str] [--robot.ip str] [--robot.port str] [--robot.video_port str] [--robot.cameras str] [--robot.calibration_dir str] [--robot.leader_arms str] [--robot.follower_arms str] [--robot.teleop_keys str] [--robot.mock str] [--control str] [--control.type {calibrate,teleoperate,record,replay,remote_robot}] [--control.arms str] [--control.teleop_time_s str] [--control.single_task str] [--policy str] [--control.policy.type {act,diffusion,pi0,smolvla,tdmpc,vqbet,pi0fast}] [--control.policy.replace_final_stride_with_dilation str] [--control.policy.pre_norm str] [--control.policy.dim_model str] [--control.policy.n_heads str] [--control.policy.dim_feedforward str] [--control.policy.feedforward_activation str] [--control.policy.n_encoder_layers str] [--control.policy.n_decoder_layers str] [--control.policy.use_vae str] [--control.policy.n_vae_encoder_layers str] [--control.policy.temporal_ensemble_coeff str] [--control.policy.kl_weight str] [--control.policy.optimizer_lr_backbone str] [--control.policy.drop_n_last_frames str] [--control.policy.use_separate_rgb_encoder_per_camera str] [--control.policy.down_dims str] [--control.policy.kernel_size str] [--control.policy.n_groups str] [--control.policy.diffusion_step_embed_dim str] [--control.policy.use_film_scale_modulation str] [--control.policy.noise_scheduler_type str] [--control.policy.num_train_timesteps str] [--control.policy.beta_schedule str] [--control.policy.beta_start str] [--control.policy.beta_end str] [--control.policy.prediction_type str] [--control.policy.clip_sample str] [--control.policy.clip_sample_range str] [--control.policy.num_inference_steps str] [--control.policy.do_mask_loss_for_padding str] [--control.policy.scheduler_name str] [--control.policy.attention_implementation str] [--control.policy.num_steps str] [--control.policy.train_expert_only str] [--control.policy.train_state_proj str] [--control.policy.optimizer_grad_clip_norm str] [--control.policy.vlm_model_name str] [--control.policy.load_vlm_weights str] [--control.policy.add_image_special_tokens str] [--control.policy.attention_mode str] [--control.policy.prefix_length str] [--control.policy.pad_language_to str] [--control.policy.num_expert_layers str] [--control.policy.num_vlm_layers str] [--control.policy.self_attn_every_n_layers str] [--control.policy.expert_width_multiplier str] [--control.policy.min_period str] [--control.policy.max_period str] [--control.policy.n_action_repeats str] [--control.policy.horizon str] [--control.policy.image_encoder_hidden_dim str] [--control.policy.state_encoder_hidden_dim str] [--control.policy.latent_dim str] [--control.policy.q_ensemble_size str] [--control.policy.mlp_dim str] [--control.policy.discount str] [--control.policy.use_mpc str] [--control.policy.cem_iterations str] [--control.policy.max_std str] [--control.policy.min_std str] [--control.policy.n_gaussian_samples str] [--control.policy.n_pi_samples str] [--control.policy.uncertainty_regularizer_coeff str] [--control.policy.n_elites str] [--control.policy.elite_weighting_temperature str] [--control.policy.gaussian_mean_momentum str] [--control.policy.max_random_shift_ratio str] [--control.policy.reward_coeff str] [--control.policy.expectile_weight str] [--control.policy.value_coeff str] [--control.policy.consistency_coeff str] [--control.policy.advantage_scaling str] [--control.policy.pi_coeff str] [--control.policy.temporal_decay_coeff str] [--control.policy.target_model_momentum str] [--control.policy.n_action_pred_token str] [--control.policy.action_chunk_size str] [--control.policy.vision_backbone str] [--control.policy.crop_shape str] [--control.policy.crop_is_random str] [--control.policy.pretrained_backbone_weights str] [--control.policy.use_group_norm str] [--control.policy.spatial_softmax_num_keypoints str] [--control.policy.n_vqvae_training_steps str] [--control.policy.vqvae_n_embed str] [--control.policy.vqvae_embedding_dim str] [--control.policy.vqvae_enc_hidden_dim str] [--control.policy.gpt_block_size str] [--control.policy.gpt_input_dim str] [--control.policy.gpt_output_dim str] [--control.policy.gpt_n_layer str] [--control.policy.gpt_n_head str] [--control.policy.gpt_hidden_dim str] [--control.policy.dropout str] [--control.policy.mlp_hidden_dim str] [--control.policy.offset_loss_weight str] [--control.policy.primary_code_loss_weight str] [--control.policy.secondary_code_loss_weight str] [--control.policy.bet_softmax_temperature str] [--control.policy.sequentially_select str] [--control.policy.optimizer_vqvae_lr str] [--control.policy.optimizer_vqvae_weight_decay str] [--control.policy.n_obs_steps str] [--control.policy.normalization_mapping str] [--control.policy.input_features str] [--control.policy.output_features str] [--control.policy.device str] [--control.policy.use_amp str] [--control.policy.chunk_size str] [--control.policy.n_action_steps str] [--control.policy.max_state_dim str] [--control.policy.max_action_dim str] [--control.policy.resize_imgs_with_padding str] [--control.policy.interpolate_like_pi str] [--control.policy.empty_cameras str] [--control.policy.adapt_to_pi_aloha str] [--control.policy.use_delta_joint_actions_aloha str] [--control.policy.tokenizer_max_length str] [--control.policy.proj_width str] [--control.policy.max_decoding_steps str] [--control.policy.fast_skip_tokens str] [--control.policy.max_input_seq_len str] [--control.policy.use_cache str] [--control.policy.freeze_vision_encoder str] [--control.policy.freeze_lm_head str] [--control.policy.optimizer_lr str] [--control.policy.optimizer_betas str] [--control.policy.optimizer_eps str] [--control.policy.optimizer_weight_decay str] [--control.policy.scheduler_warmup_steps str] [--control.policy.scheduler_decay_steps str] [--control.policy.scheduler_decay_lr str] [--control.policy.checkpoint_path str] [--control.policy.padding_side str] [--control.policy.precision str] [--control.policy.grad_clip_norm str] [--control.policy.relaxed_action_decoding str] [--control.warmup_time_s str] [--control.episode_time_s str] [--control.reset_time_s str] [--control.num_episodes str] [--control.video str] [--control.push_to_hub str] [--control.private str] [--control.tags str] [--control.num_image_writer_processes str] [--control.num_image_writer_threads_per_camera str] [--control.resume str] [--control.repo_id str] [--control.episode str] [--control.root str] [--control.fps str] [--control.play_sounds str] [--control.log_interval str] [--control.display_data str] [--control.viewer_ip str] [--control.viewer_port str] control_robot.py: error: unrecognized arguments: --control.local_files_only=true
最新发布
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值