npm install -g expo-cli , installation error

553 views Asked by At

I install npm to create my react-native project by using following command

npm install -g expo-cli 

but unfortunately i can't install it. it gives following error.

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\kkawm\AppData\Roaming\npm\node_modules\.staging\@expo\xdl-f252ea11\binaries\linux\adb\adb
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\kkawm\AppData\Roaming\npm\node_modules\.staging\@expo\xdl-f252ea11\binaries\linux\adb\adb'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\kkawm\AppData\Roaming\npm\node_modules\.staging\@expo\xdl-f252ea11\binaries\linux\adb\adb'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\kkawm\AppData\Roaming\npm\node_modules\.staging\@expo\xdl-f252ea11\binaries\linux\adb\adb'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\\Users\\kkawm\\AppData\\Roaming\\npm\\node_modules\\.staging\\@expo\\xdl-f252ea11\\binaries\\linux\\adb\\adb'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\kkawm\\AppData\\Roaming\\npm\\node_modules\\.staging\\@expo\\xdl-f252ea11\\binaries\\linux\\adb\\adb',
npm ERR!   parent: 'expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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!     C:\Users\kkawm\AppData\Roaming\npm-cache\_logs\2020-08-03T05_57_40_929Z-debug.log 

How I solve this error?

2

There are 2 answers

0
Kaumadie Kariyawasam On BEST ANSWER

I tried to install npm using npm installbut it gives following warnings.

npm WARN saveError ENOENT: no such file or directory, open 'F:\ucsc\3rd year\Mobile Application Development\lec. notes\abc\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'F:\ucsc\3rd year\Mobile Application Development\lec. notes\abc\package.json'
npm WARN abc No description
npm WARN abc No repository field.
npm WARN abc No README data
npm WARN abc No license field.

up to date in 1.557s

hence I use npm install -g npm. it installed sucessfully

after i install expo-cli using npm install -g expo-cli it installed sucessfully

0
Anil Kumar On

Try running npm install -g expo-cli from a terminal