无法通过 NPM 安装 Expo CLI [英] Unable to install Expo CLI through NPM

查看:25
本文介绍了无法通过 NPM 安装 Expo CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一切正常,我正在运行 Expo 版本 3.11.5,但日志说将其更新到 3.11.7.我运行了那个命令,它毁了我的项目.

请在下面找到错误日志.

PS C:UsersMY PCMy_React_Nativefruits-vegetables>npm install --global expo-clinpm WARN deprecated joi@14.0.4:根据 hapi 支持政策 (hapi.im/support),此版本已被弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN deprecated core-js@2.6.11: core-js@<3 不再维护,由于问题数量不推荐使用.请将您的依赖项升级到 core-js@3 的实际版本.npm WARN 已弃用 joi@11.4.0:根据 hapi 支持政策 (hapi.im/support),此版本已弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN deprecated topo@2.0.2:根据 hapi 支持政策 (hapi.im/support),此版本已被弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN 已弃用 hoek@4.2.1:根据 hapi 支持政策 (hapi.im/support),此版本已弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN 已弃用 hoek@6.1.3:此模块已移动,现在可在 @hapi/hoek 获得.请更新您的依赖项,因为此版本不再维护可能包含错误和安全问题.npm WARN 已弃用 topo@3.0.3:此模块已移动,现在可在 @hapi/topo 找到.请更新您的依赖项,因为此版本不再维护npm WARN rollback 回滚 mime@2.4.4 失败(这可能是无害的):EPERM: operation not allowed, lstat 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expowebpack-pwa-manifest-plugin
ode_modules'npm WARN @expo/image-utils@0.2.12 需要一个同级的 sharp-cli@^1.10.0 但没有安装.您必须自己安装对等依赖项.npm 错误!代码 EPERMnpm 错误!系统调用取消链接npm 错误!路径 C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exenpm 错误!错误号-4048npm 错误!错误:EPERM:不允许操作,取消链接 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exe'npm 错误![OperationalError: EPERM: operation not allowed, unlink 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exe'] {npm 错误!原因:[错误:EPERM:不允许操作,取消链接 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.可执行程序'] {npm 错误!错误号:-4048,npm 错误!代码:'EPERM',npm 错误!系统调用:'取消链接',npm 错误!路径:'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\adb.exe'npm 错误!},npm 错误!堆栈:错误:EPERM:不允许操作,取消链接 'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\adb.exe'",npm 错误!错误号:-4048,npm 错误!代码:'EPERM',npm 错误!系统调用:'取消链接',npm 错误!路径:'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\adb.exe',npm 错误!父:'expo-cli'npm 错误!}npm 错误!npm 错误!该操作被您的操作系统拒绝.npm 错误!该文件可能已被使用(由文本编辑器或防病毒软件),npm 错误!npm 错误!如果您认为这可能是权限问题,请仔细检查npm 错误!文件及其包含目录的权限,或尝试运行npm 错误!再次以 root/管理员身份执行该命令.npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:UsersMY PCAppDataRoaming
pm-cache\_logs2020-01-24T15_03_46_770Z-debug.logPS C:UsersMY PCMy_React_Nativefruits-vegetables>npm i -g expo-cli@3.11.7npm WARN deprecated joi@14.0.4:根据 hapi 支持政策 (hapi.im/support),此版本已被弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN deprecated core-js@2.6.11: core-js@<3 不再维护,由于问题数量不推荐使用.请将您的依赖项升级到 core-js@3 的实际版本.npm WARN 已弃用 joi@11.4.0:根据 hapi 支持政策 (hapi.im/support),此版本已弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN 已弃用 hoek@4.2.1:根据 hapi 支持政策 (hapi.im/support),此版本已弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN deprecated topo@2.0.2:根据 hapi 支持政策 (hapi.im/support),此版本已被弃用.请升级到最新版本以获得最佳功能、错误修复和安全补丁.如果您此时无法升级,可以为旧版本 (hapi.im/commercial) 提供付费支持.npm WARN 已弃用 topo@3.0.3:此模块已移动,现在可在 @hapi/topo 找到.请更新您的依赖项,因为此版本不再维护可能包含错误和安全问题.npm WARN 已弃用 hoek@6.1.3:此模块已移动,现在可在 @hapi/hoek 获得.请更新您的依赖项,因为此版本不再维护可能包含错误和安全问题.npm WARN rollback 回滚验证器@11.0.0 失败(这可能是无害的):EPERM: operation not allowed, scandir 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expoxdl
ode_modules'npm WARN @expo/image-utils@0.2.12 需要一个同级的 sharp-cli@^1.10.0 但没有安装.您必须自己安装对等依赖项.npm 错误!代码 EBUSYnpm 错误!系统调用 rmdirnpm 错误!路径 C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbnpm 错误!错误号-4082** npm 错误!EBUSY:资源繁忙或锁定,rmdir 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadb'**npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:UsersMY PCAppDataRoaming
pm-cache\_logs2020-01-24T17_42_41_316Z-debug.log

  1. 我有 McAfee 防病毒软件和 Windows 防火墙.防火墙和实时文件时间检查已经停止,我在 Windows 防火墙的排除项中添加了 node.exe.
  2. 我还将 adb.exe 文件放在 McAfee 和 Windows 防火墙的排除项中.
  3. 我也尝试过通过 Windows Power Shell(管理员)运行 npm install -g expo-cli 命令.

我还能做什么?

解决方案

按照以下步骤:(使用终端)

  1. 如果已安装且遇到问题或想要更新,请卸载以前的版本.

<块引用>

npm -g 卸载 expo-cli --save

  1. 只需重新启动您的 PC 以清除缓存,然后再次安装 expo.

<块引用>

npm install expo-cli --global

  1. 检查是否安装并验证版本.只需输入

<块引用>

博览会--版本

All was working fine and I was running Expo version 3.11.5, but the log said to update it to 3.11.7. I ran that command and it ruined my project.

Please find the error logs below.

PS C:UsersMY PCMy_React_Nativefruits-vegetables> npm install --global expo-cli
npm WARN deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). 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 core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). 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/support). 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/support). 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@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained 
an may contain bugs and security issues.
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained 
npm WARN rollback Rolling back mime@2.4.4 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expowebpack-pwa-manifest-plugin
ode_modules'
npm WARN @expo/image-utils@0.2.12 requires a peer of sharp-cli@^1.10.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exe
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exe'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exe'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadbadb.exe'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\adb.exe'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, unlink 'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\adb.exe'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb\adb.exe',
npm ERR!   parent: 'expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersMY PCAppDataRoaming
pm-cache\_logs2020-01-24T15_03_46_770Z-debug.log
PS C:UsersMY PCMy_React_Nativefruits-vegetables> npm i -g expo-cli@3.11.7     
npm WARN deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). 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 core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). 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/support). 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/support). 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 dependencies 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 dependencies as this version is no longer maintained 
an may contain bugs and security issues.
npm WARN rollback Rolling back validator@11.0.0 failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expoxdl
ode_modules'
npm WARN @expo/image-utils@0.2.12 requires a peer of sharp-cli@^1.10.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code EBUSY
npm ERR! syscall rmdir
npm ERR! path C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadb
npm ERR! errno -4082
**npm ERR! EBUSY: resource busy or locked, rmdir 'C:UsersMY PCAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo.xdl.DELETEinarieswindowsadb'**     

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersMY PCAppDataRoaming
pm-cache\_logs2020-01-24T17_42_41_316Z-debug.log

  1. I have McAfee Anti-virus and Windows Firewall. The firewall and real file time checking has already been stopped and I have added node.exe in the exclusion of Windows Firewall.
  2. I have also placed adb.exe file in the exclusion for McAfee and Windows Firewall.
  3. I have also tried running the npm install -g expo-cli command through Windows Power Shell (Administrator).

What else can I do?

解决方案

Follow these steps: (using terminal)

  1. uninstall previous version if already installed and facing problem or wants to update.

npm -g uninstall expo-cli --save

  1. simply restart your PC to clear cache memory and than install expo again.

npm install expo-cli --global

  1. To check whether it installed or not and also verify version. simply type

expo --version

这篇关于无法通过 NPM 安装 Expo CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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