错误:EPERM无法安装@ angular / cli

我已经尝试安装angular度cli与最新版本的节点,如你所说。 但这是不成功的。 我只用pipe理员用户尝试过

仅供参考 – 我已经在另一台机器上尝试过,也有同样的说法
操作系统:Windows7 64
节点v7.9.0
npm:v4.2.0
错误:EPERM:操作不允许重命名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 

不幸的是,Angular CLI有时在Windows机器上有一些问题。 请查看下面的线索,了解我尝试过的一些可能的解决scheme: https : //github.com/angular/angular-cli/issues/1349

无法findC:\ Users \\ AppData \ Roaming \ npm \ node_modules下的.angular-cli.DELETE文件

因此我已经删除了整个节点模块文件夹,并做了npmcaching清除,然后尝试。 有效

我有同样的问题,所以我试图安装它使用node.js命令提示符而不是默认的,它的工作。

我希望它可以帮助别人。