'react-native' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'react-native' is not recognized as an internal or external command, operable program or batch file

查看:59
本文介绍了'react-native' 不是内部或外部命令,也不是可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用 react-native.我使用 facebook 网站上的教程安装它,一两天内一切正常,直到出现此消息:

I recently started with react-native. I install it using the tutorial on the facebook site and everything works well for a day or two, until this message comes up:

'react-native' is not recognized as an internal or external command,
operable program or batch file.

除了卸载所有内容并重新开始外,什么都不起作用.环境还可以并且可以工作(npm、choco 等).我还尝试删除和添加 react-native 到环境变量,重新启动,在管理员模式下运行 cmd,但到目前为止还没有.我应该补充一点,我使用的是 Windows 10 64 位.

Nothing works except uninstalling everything and starting all over again. The environments are ok and work (npm, choco, etc.). I have also tried removing and adding react-native to environment variables, restarting, running cmd in administrator mode, but nothing so far. I should add that I use windows 10 64-bit.

推荐答案

我遇到了同样的问题并尝试了以下但没有奏效1) 将 npm 路径添加到我的环境变量中;系统和用户2) 重新安装 npm 和 react-native-cli

I had the same issue and tried the following but didnt work 1) Adding npm path to my Environment variables; both system and user 2) Re install npm and react-native-cli

两者都不适合我,我使用的是 Windows 10;

Both didn't work for me, im using Windows 10;

对我有用的解决方案是全局安装 react-native-cli您可以使用以下命令全局安装它:

Solution that worked for me is to install react-native-cli globally You can install it globally by using the below command:

npm install -g react-native-cli

希望能帮到你!干杯:)

Hope that helps you! Cheers :)

这篇关于'react-native' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆