I tried installing angular cli with npm. But I'm getting the below error while executing the command npm install -g @angular/cli. I am not executing this command as admin, but as a user.
D:\AngularWorkstation>npm install -g @angular/cli
npm WARN sass-loader@6.0.6 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! path **D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json.365294863
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json.365294863' -> 'D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json'
npm ERR! { Error: EPERM: operation not permitted, rename 'D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json.365294863' -> 'D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json'
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, rename 'D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json.365294863' ->** 'D:\node_modules\node_modules\@angular\cli\node_modules\which\package.json'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\node_modules\\node_modules\\@angular\\cli\\node_modules\\which\\package.json.365294863',
npm ERR! dest: 'D:\\node_modules\\node_modules\\@angular\\cli\\node_modules\\which\\package.json' },
npm ERR! stack: 'Error: EPERM: operation not permitted, rename \'D:\\node_modules\\node_modules\\@angular\\cli\\node_modules\\which\\package.json.365294863\' -> \'D:\\node_modules\\node_modules\\@angular\\cli\\node_modules\\which\\package.json\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\node_modules\\node_modules\\@angular\\cli\\node_modules\\which\\package.json.365294863',
npm ERR! dest: 'D:\\node_modules\\node_modules\\@angular\\cli\\node_modules\\which\\package.json',
npm ERR! parent: '@angular/cli' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\techno\AppData\Roaming\npm-cache\_logs\2018-01-03T09_14_35_602Z-debug.log
*PS : I'm using Windows10 OS. I also tried changing the npm global path to'D:\node_modules' to check if it's due to permission issue. However the output is the same.
node --version : v7.7.2
npm --version : 4.1.2*