简体   繁体   English

Expo 在使用 npm 安装期间卡住,但使用纱线安装并且不起作用

[英]Expo gets stuck during install with npm but installs with yarn and doesn't work

When I try installing expo using npm install -g expo-cli , it gets stuck for hours here - expo-cli error当我尝试使用npm install -g expo-cli ,它在这里卡住了几个小时 - expo-cli 错误

npm WARN deprecated @hapi/joi@17.1.1: joi is leaving the @hapi organization and moving back to 'joi' ( https://github.com/sideway/joi/issues/2411 ) [..................] \\ fetchMetadata: WARN deprecated @hapi/joi@17.1.1: joi is leaving the @hapi organization and moving back to 'joi' ( https://github.com/sideway/joi/ npm WARN 已弃用 @hapi/joi@17.1.1:joi 将离开 @hapi 组织并回到“joi”( https://github.com/sideway/joi/issues/2411 )[...... ............] \\ fetchMetadata: WARN deprecated @hapi/joi@17.1.1: joi 将离开 @hapi 组织并回到 'joi' ( https://github.com/侧身/joi/

But when I use yarn to install expo, it says expo is installed successfully.但是当我使用yarn安装expo时,它说expo安装成功。 But it doesn't work when I type expo --version or just expo in cmd.但是当我在 cmd 中输入expo --version或只是expo时它不起作用。

I've tried changing the environment path I've uninstalled and reinstalled node I've tried npm cache clean --force我尝试更改环境路径 我已经卸载并重新安装了节点 我已经尝试过npm cache clean --force

npm install --global expo-cli --force npm install --global expo-cli --force

That's what did it for me.这就是为我所做的。 Same errors at the beginning of the installation attempt, but afterwards it ignored the issues and installed it anyways.在安装尝试开始时出现相同的错误,但之后它忽略了这些问题并仍然安装了它。 And it works just fine.它工作得很好。 Though, usually you should be careful with " --force".不过,通常你应该小心“--force”。

I had this problem in Windows 10, to be able to install the latest version.我在 Windows 10 中遇到了这个问题,以便能够安装最新版本。 I had to install the latest version of Python (3.8.0) and then run npm install --global --production windows-build-tools as an administrator, then I was able to run again: npm install expo-cli --global to install the version 3.8.0 of the expo-cli我必须安装最新版本的 Python (3.8.0),然后以管理员身份运行npm install --global --production windows-build-tools ,然后我才能再次运行: npm install expo-cli --global安装 3.8.0 版的 expo-cli

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM