1
votes

When I tried to Install node dependencies again I got the below error. I deleted the node modules folder and installed again and it installed correctly but I want to know why this error has occurred. Please help me on this.

D-4417845 MINGW64 /d/Project_Worksapce/angular2-reddit-master/angular2-reddit-master $ npm install

[email protected] D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master

+-- [email protected]

+-- [email protected]

+-- [email protected]

+-- [email protected]

+-- [email protected]

+-- [email protected]

+-- [email protected]

`-- [email protected]

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "D:\Node\node.exe" "D:\Node\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v6.10.1 npm ERR! npm v3.10.10 npm ERR! path D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules.staging\angular2-751451fd npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules.staging\angular2-751451fd' -> 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules\angular2' npm ERR! at destStatted (D:\Node\node_modules\npm\lib\install\action\finalize.js:25:7) npm ERR! at D:\Node\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29 npm ERR! at FSReqWrap.oncomplete (fs.js:123:15) npm ERR! npm ERR! Error: EPERM: operation not permitted, rename 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules.staging\angular2-751451fd' -> 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules\angular2' npm ERR! at Error (native) npm ERR! { Error: EPERM: operation not permitted, rename 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules.staging\angular2-751451fd' -> 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules\angular2' npm ERR! at destStatted (D:\Node\node_modules\npm\lib\install\action\finalize.js:25:7) npm ERR! at D:\Node\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29 npm ERR! at FSReqWrap.oncomplete (fs.js:123:15) npm ERR! npm ERR! Error: EPERM: operation not permitted, rename 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules.staging\angular2-751451fd' -> 'D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\node_modules\angular2' npm ERR! at Error (native) parent: 'ng-book2-reddit' } 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! D:\Project_Worksapce\angular2-reddit-master\angular2-reddit-master\npm-debug.log

1
Everything is in the error message, you probably did an npm install using administrator rights and now it needs to remove/rename folders but it doesn't have permissions for that.Supamiu
Supamiu , I installed with administrator privileges only but when I tried to install the dependencies again I am getting the error so I deleted the node modules folder and then installed again and its working.Nasrul Bharathi

1 Answers

0
votes

When we already have node modules then when we give "npm install" it will check all the dependencies and if it is already present then it will ignore and install only those which is not present. Sometime it will throw such an error.Not sure why it happens but I deleted the node modules folder and then installed again and its work perfectly.