2017-04-26 219 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導致的。在傳統的命令提示符下運行解決了這個問題。

相關問題