2017-04-26 128 views
1

我试图安装角度cli与最新版本的节点,如您所述。但它不成功。我曾与管理员用户尝试只错误:EPERM无法安装@ angular/cli

FYI-我已经尝试过了其他机器新鲜那里也是它说了同样的
操作系统: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: [email protected]^1.0.0 (node_modules\@a 
ngular\cli\node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected] 
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 

回答

1

不幸的是,Angular CLI有时在Windows机器上有一些问题。请看看以下螺纹的一些可能的解决方案,我想和工作:https://github.com/angular/angular-cli/issues/1349

无法找到在C .angular-cli.DELETE文件:\ USERS \\应用程序数据\漫游\故宫\ node_modules

因此我已经删除了整个节点模块文件夹,并且清除了npm缓存,然后尝试了。它的工作

1

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

我希望它可以帮助别人。

0

对我来说,这个问题是由于在PowerShell中运行npm install导致的。在传统的命令提示符下运行解决了这个问题。

相关问题