I wanna reinstall expo-cli, but there is err. And can't uninstall expo-cli

4.4k Views Asked by At

I tried to build the app through expo but failed, and I tried to reinstall expo-cli. So, I entered the code below to remove the expo-cli.

npm -g uninstall expo-cli --save

and

(base) Bongui-MacBookPro:expo-firebase-master bong$ npm uninstall expo-cli -g
up to date in 0.042s

However, if i type expo, it will run.

So if you ignore it again and try to reinstall expo-cli, The following errors occur:

npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/expo-cli/bin/expo.js
npm ERR! dest /Users/bong/npm-global/bin/expo-cli
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/expo-cli/bin/expo.js' -> '/Users/bong/npm-global/bin/expo-cli'
npm ERR! File exists: /Users/bong/npm-global/bin/expo-cli
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bong/.npm/_logs/2020-01-28T09_18_38_604Z-debug.log

Thank you, teachers. Please help me solve the problem. Thank you.

2

There are 2 best solutions below

0
JohnBegood On BEST ANSWER

I think you might want to overwrite your current folder while you building. Try and use the --force extension in your command and that will resolve the problem. I presume something like : npm install -g --force expo-cli

I hope that will help.

1
Rakesh Kanna On

I am using linux , Ubuntu i tried

sudo npm install -g --force expo-cli

it worked for me.