首页 > 解决方案 > 将 expo cli 升级到最新版本。我收到了这个错误

问题描述

我尝试将 expo cli 升级到最新版本。我得到了这个错误。

DALAs-MacBook-Pro:~ SEAR$ npm i -g expo-cli
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/expo-cli
npm ERR! dest /usr/local/lib/node_modules/.expo-cli-dKBr48UN
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -> '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -> '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/usr/local/lib/node_modules/expo-cli',
npm ERR!   dest: '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
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!     /Users/sear/.npm/_logs/2021-06-26T14_35_24_132Z-debug.log

节点:v13.14.0 NPM:7.7.5 当前博览会:3.18.0

请帮助,在此先感谢。

标签: node.jsnpmnode-modulesexpo

解决方案


它是通过运行 sudo npm i -g expo-cli 修复的。


推荐阅读