我未能安装使用npm install -g expo-cli创建android应用程序的expo。
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命令,因为我使用Ubuntu20.04操作系统,并再次运行npm install -g expo-cli命令。
注意:我每次都失败了,我需要帮助来安装expo-cli。高级谢谢,并请关注所附文件。

发布于 2021-07-27 06:50:39
您必须尝试两种方法:
。
也许它会有用
https://stackoverflow.com/questions/68540107
复制相似问题