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

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

问题描述

一切正常,我正在运行Expo版本1.5.1.5,但日志显示将其更新为3.11.7. 我执行了该命令,这毁了我的项目.

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:\Users\MY PC\My_React_Native\fruits-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:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\webpack-pwa-manifest-plugin\node_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:\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! 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!  [OperationalError: 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!   cause: [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!   },
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:\Users\MY PC\AppData\Roaming\npm-cache\_logs\2020-01-24T15_03_46_770Z-debug.log
PS C:\Users\MY PC\My_React_Native\fruits-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:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\xdl\node_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:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb
npm ERR! errno -4082
**npm ERR! EBUSY: resource busy or locked, rmdir 'C:\Users\MY PC\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\.xdl.DELETE\binaries\windows\adb'**     

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MY PC\AppData\Roaming\npm-cache\_logs\2020-01-24T17_42_41_316Z-debug.log

  1. 我有McAfee Anti-virus和Windows防火墙.防火墙和实时文件时间检查已经停止,我在Windows防火墙中添加了node.exe.
  2. 我还将adb.exe文件放入了McAfee和Windows防火墙的排除范围.
  3. 我还尝试通过Windows Power Shell(管理员)运行npm install -g expo-cli命令.
  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).

我还能做什么?

推荐答案

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

Follow these steps: (using terminal)

  1. 卸载先前版本(如果已安装且遇到问题或想要更新).

npm -g卸载expo-cli --save

npm -g uninstall expo-cli --save

  1. 只需重新启动您的PC即可清除缓存,然后再次安装expo.
  1. simply restart your PC to clear cache memory and than install expo again.

npm install expo-cli --global

npm install expo-cli --global

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

expo --version

expo --version

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

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