Pana / nrm

NPM registry manager, fast switch between different registries: npm, cnpm, nj, taobao
MIT License
2.8k stars 244 forks source link

npm install -g nrm fails on Windows: "Error: EPERM: operation not permitted, rename" #28

Closed Eric-art-coder closed 5 years ago

Eric-art-coder commented 7 years ago

$ npm install -g nrm C:\Users\lenovo\AppData\Roaming\npm `-- (empty)

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "nrm" npm ERR! node v6.3.1 npm ERR! npm v3.10.3 npm ERR! path C:\Users\lenovo\AppData\Roaming\npm\node_modules\nrm\node_modules\npm\node_modules\node-gyp\node_modules\minimatch\node_modules\brace-expansion npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\lenovo\AppData\Roaming\npm\node_modules\nrm\node_modules\npm\node_modules\node-gyp\node_modules\minimatch\node_modules\brace-expansion' -> 'C:\Users\lenovo\AppData\Roaming\npm\node_modules\nrm\node_modules\npm\node_modules\node-gyp\node_modules\minimatch\node_modules.brace-expansion.DELETE' npm ERR! at moveAway (E:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:38:5) npm ERR! at destStatted (E:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:27:7) npm ERR! at FSReqWrap.oncomplete (fs.js:123:15) npm ERR! ...... npm ERR! at Error (native) parent: 'minimatch' } 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\lenovo\Desktop\npm-debug.log npm ERR! code 1

BUT! on git bash run cli npm cache clean,it works

wujr5 commented 7 years ago

It looks like you should run the command as root. @guimeisang

PrescottPS commented 7 years ago

try this:

ErikRobles commented 5 years ago

@wujr5 I think this is my problem as well. Can you give an example of using root. Thank you.