Title: Failed to install "expo-cli" using "npm install -g expo-cli"
Tags: javascript;react-native;npm;expo
Question: I am failed to install expo-cli using ```npm install -g expo-cli```  for android application creation.
NPM version: ```7.19.1```
Node version: ```v15.14.0```
After using ```npm install -g expo-cli``` it's failed to install and the error is given below,
```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' -&gt; '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -&gt; '/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
```
I have tried to solve this issue and use the below command's: ```npm cache clean --force``` but it was not solved and that's why I have used  ```sudo npm cache clean --force``` command because of using Ubuntu 20.04 operating system and again run ```npm install -g expo-cli``` command.
Note: I am failed every time and I need help to install ```expo-cli```. Advanced thanks and please concern the attached file.



Here is the accepted answer: You have to try two methods:

First is to use the command with sudo npm install expo-cli (if you have not used sudo)
the Second is to delete node_modules and install run again npm install

Maybe it will work

Comment for this answer: which option help you ?
Comment for this answer: Delete the previous "node_modules" and then use the `sudo npm install -g expo-cli ` command to install


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:07/27/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<javascript><react-native><npm><expo>', 'Title': 'Failed to install "expo-cli" using "npm install -g expo-cli"', 'ViewCount': 404, 'id': 68540107, 'user_AboutMe': '<p>In the early of my life, <strong>studay abroad</strong> I mostly wanted and for that I am working to prepared myself.\nI am <strong>CSE student</strong> and working with <strong>Machine Learning</strong> and <strong>Reinforcement Learning</strong> I mostly like. I have already completed some Web project and also ML projects and working for research Papers publications. I already add some of my achievements in <strong>Developer Story</strong>.</p>\n<p>And I am <strong>Full Stack Software Developer</strong> using <strong>Laravel, ReactJS, JavaScript, Bootstrap, CSS, HTML</strong>.</p>\n<blockquote>\n<p>As a programmer my life moto is,</p>\n</blockquote>\n<pre><code>//Life Moto    \nif(sad()===true){\n        sad().stop();\n        beAwesome();\n    }\n</code></pre>\n<p>Coursera Profile Link: <a href="http://coursera.org/user/ea9da3779d1536160b2d36e4054fa429" rel="nofollow noreferrer">Imdadul Haque</a></p>\n', 'user_AccountId': 19247185.0, 'user_DisplayName': 'Imdadul Haque', 'user_Reputation': 977.0, 'user_Views': 239.0, 'user_id': 14065992.0}}