I opened the cmd window as administrator and ran npm install on a folder, got this error at one point:
npm ERR! Error: EPERM: operation not permitted, rename 'MyFolder\node_modules\.staging\@angular\common-54da66e9' -> 'MyFolder\node_modules\@angular\common'
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
Same seems to work on other machines!
Can someone help me fix this?
code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer. This means that npm fails to install the node-sass module that's added as a dependency to the n-app project.
I had this problem recently at my work place. In my case what I was doing was, I had the project open in the editor(I use VScode, which is cool:)) and then in the cmd window I was trying to run npm install on the same project folder. I got the same error no matter what I did.
The thing that solved the issue for me is, whenever I try to do npm install I close the editor window in which the project is opened and then run npm install from the cmd window. This works without any issues for me.
By the way I have observed that this is only with windows I guess, on my mac I have never encountered this issue.
working under windows 10 I opened the CMD as an administrator and that fixed my issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With