npm install -g expo-cli未能完成安装。

3

我正在尝试使用nvm安装expo-cli,但出现了某些问题。在安装过程中,它会到达某个特定点,然后就停止了。

我尝试使用不同的node版本,并尝试删除可能阻止安装的权限,但仍然没有成功。这是控制台显示的内容:

npm WARN deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated @babel/polyfill@7.4.4: ? As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly
npm WARN deprecated including core-js/stable (to polyfill ECMAScript
npm WARN deprecated features) and regenerator-runtime/runtime
npm WARN deprecated (needed to use transpiled generator functions):
npm WARN deprecated
npm WARN deprecated   > import "core-js/stable";
npm WARN deprecated   > import "regenerator-runtime/runtime";
npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencie
s as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencie
s as this version is no longer maintained an may contain bugs and security issues.
npm WARN tarball tarball data for @expo/traveling-fastlane-linux@1.9.11 (sha512-xCHnqKfwWYygQfRbi9MGNSG28EHKDtzMB+QDklSH
1GeD90TA0beAjlNF+Z+KPxj28s3WZlQr9yw1AqBS7aipcw==) seems to be corrupted. Trying one more time.

你尝试过在运行“nvm install”命令之前添加“sudo”吗?如果你使用的是Mac或Linux系统。 - Deano
我目前正在使用Windows 10和PowerShell。我一直以管理员身份运行PowerShell,如果有帮助的话。 - Trevor Strong
3个回答

2

您使用的是哪个终端?如果是GitBash,则可能出现问题,请尝试使用其他终端,这样可以解决问题。


0

我在 Windows 10 上的命令行(而不是 PowerShell)遇到了与“@expo/traveling-fastlane-linux@1.9.11 的 tarball 数据似乎已损坏”完全相同的问题,以管理员身份运行 cmd 解决了这个问题。


0

我有同样的问题。看起来是权限问题。按照文档,我使用了一个node版本管理器重新安装了npm。作为一个Linux用户,我使用nvm(请查看文档选择适当的管理器)。

卸载了npm和node之后,我运行了以下命令:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash

使用以下命令检查安装:

command -v nvm

输出必须是nvm

最后,运行:

npm install -g expo-cli

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接