node.jsangularangular2-cli

Error: EPERM Unable to install @angular/cli


I have tried to install angular cli with latest version of node as you mentioned. But it is unsuccessful. I have tried it with admin user only

FYI- I have tried it on another machine freshly there also it says the same
OS: windows7 64
node v7.9.0
npm: v4.2.0
error: EPERM: operation not permitted to rename package.json

C:\Windows\system32>npm install -g @angular/cli --save
C:\Users\001091\AppData\Roaming\npm
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\@a
ngular\cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli" "--save"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! path C:\Users\001091\AppData\Roaming\npm\node_modules\.staging\url-pars
e-e45d5bd3\package.json.1317145617
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\001091\AppData\
Roaming\npm\node_modules\.staging\url-parse-e45d5bd3\package.json.1317145617' ->
 'C:\Users\001091\AppData\Roaming\npm\node_modules\.staging\url-parse-e45d5bd3\p
ackage.json'
npm ERR!  { Error: EPERM: operation not permitted, rename 'C:\Users\001091\AppDa
ta\Roaming\npm\node_modules\.staging\url-parse-e45d5bd3\package.json.1317145617'
 -> 'C:\Users\001091\AppData\Roaming\npm\node_modules\.staging\url-parse-e45d5bd
3\package.json'
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Users\\001091\\AppData\\Roaming\\npm\\node_modules\\.stagi
ng\\url-parse-e45d5bd3\\package.json.1317145617',
npm ERR!   dest: 'C:\\Users\\001091\\AppData\\Roaming\\npm\\node_modules\\.stagi
ng\\url-parse-e45d5bd3\\package.json',
npm ERR!   parent: '@angular/cli' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\001091\AppData\Roaming\npm-cache\_logs\2017-04-26T06_18_55
_108Z-debug.log

Solution

  • Unfortunately, the Angular CLI sometimes has some issues on Windows machines. Please have a look at the following thread for some possible solutions which I tried and worked: https://github.com/angular/angular-cli/issues/1349

    Unable to find .angular-cli.DELETE file under C:\Users\\AppData\Roaming\npm\node_modules

    hence I have deleted the entire node modules folder and did npm cache clear and then tried. it worked