“世博会”不被识别为内部或外部命令

发布于 2025-01-18 11:44:35 字数 121 浏览 0 评论 0原文

我使用NPM安装了Expo-CLI,但是成功安装后,当我尝试运行Expo-version时,它显示了该博览会中的Expo。我尝试为环境变量添加路径,但这似乎不起作用。我必须开始研究React Native。这个问题有什么问题吗?

I installed expo-cli using npm but after the successful installation, when i try to run expo --version, it shows that expo in nor recognized. I tried adding path to the environment variables but that doesn't seem to work. I have to start working on React Native. Are there any go throughs to this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ˉ厌 2025-01-25 11:44:35

有多个解决方案可以获取

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

解决方案1

确保您已将其安装为全局
NPM

npm  install -g expo-cli

对于纱线解决方案的

yarn add -g expo-cli

2,

请确保已添加

%USERPROFILE%\AppData\Roaming\npm

到环境变量中。我已经面对这个问题,并通过将上述添加到我的环境变量

解决方案3

中解决了我不知道该解决方案的分类,请尝试

npm cache clear -f

在您的终端中运行,并且

npm install -g expo-cli

There is more than one solution to get

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

Solution 1

Make sure you have installed it global
For npm

npm  install -g expo-cli

For Yarn

yarn add -g expo-cli

Solution 2

Make Sure you have added

%USERPROFILE%\AppData\Roaming\npm

to your environmental Variable. I already faced this issue and solved by adding above to my environmental Variable

Solution 3

I don't know how to category this solution, Try to run

npm cache clear -f

in your terminal and

npm install -g expo-cli
你又不是我 2025-01-25 11:44:35

由于 expo-cli 已被弃用,尽管在全球范围内安装它对我来说是有效的;一些逆向工程给了我一个稍微好一点的解决方案。在 Windows 上使用 expo.cmd 而不是 expo

npx expo.cmd 

Since expo-cli is deprecated, even though installing it globally worked for me; a little bit of reverse engineering gave me a slightly better solution. Instead of expo use expo.cmd on windows.

npx expo.cmd 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文