Encountered an issue while trying to install expo-cli for creating android applications using npm install -g expo-cli
.
NPM version: 7.19.1
Node version: v15.14.0
Upon running npm install -g expo-cli
, the installation failed with the following error message,
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
Attempted to address this issue by running the command: npm cache clean --force
but the problem persisted. Therefore, executed the sudo npm cache clean --force
command due to operating on Ubuntu 20.04 and then retried the npm install -g expo-cli
command.
Note: Despite multiple attempts, I have been unable to successfully install expo-cli
. Appreciate any assistance provided. Thank you in advance and please refer to the attached file.