node.js - 将 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
请帮助,在此先感谢。
解决方案
它是通过运行 sudo npm i -g expo-cli 修复的。
推荐阅读
- java - 如何从他的登录打印用户类型?
- php - 使用 Guzzle 发出带有 GET 参数的 HTTP 请求
- bash - 将所有 *.512.png 移动到新文件夹的脚本
- sql - 当有多个 left_joins 时,查询忽略顺序
- vuepress - 如何将 Vue-donut-chart 库添加到 Vuepress?
- android - 横幅广告未在 Android 模拟器中显示
- javascript - 如何在 symfony 3 中制作简单的星号
- python - 自定义 Python JSON object_hook
- javascript - 如果该文件存在,则动态导入 React 组件,否则显示默认消息
- javascript - 如何使用地图坐标更新 URL?