【发布时间】:2024-05-25 14:30:01
【问题描述】:
我无法使用 npm install -g expo-cli 安装 expo-cli 以创建 Android 应用程序。
NPM 版本: 7.19.1
节点版本: v15.14.0
使用npm install -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! /home/imdadul/.npm/_logs/2021-07-27T05_54_14_633Z-debug.log
我已尝试解决此问题并使用以下命令:npm cache clean --force 但没有解决,这就是我使用sudo npm cache clean --force 命令的原因,因为使用 Ubuntu 20.04 操作系统并再次使用运行npm install -g expo-cli 命令。
注意:我每次都失败了,我需要帮助来安装expo-cli。非常感谢,请关注附件。
【问题讨论】:
标签: javascript react-native npm expo