Angular-CLI ng new:“错误:EPERM:不允许操作......" [英] Angular-CLI ng new: "Error: EPERM: operation not permitted..."

查看:29
本文介绍了Angular-CLI ng new:“错误:EPERM:不允许操作......"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Angular-CLI 安装新的 Angular2 应用程序,但一直遇到以下问题:

I am trying to use Angular-CLI to install a new Angular2 app, but keep running into the following issue:

ng new payment-calc-app

在通过 npm 安装工具包"后,我收到以下错误代码:

After "Installing packages for tooling via npm", I get the following Error codes:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (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! path C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\.staging\rxjs-ccea9159
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\.staging\rxjs-ccea9159' -> 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\rxjs'
npm ERR!     at destStatted (C:\Users\jweston\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:29:7)
npm ERR!     at C:\Users\jweston\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\.staging\rxjs-ccea9159' -> 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\rxjs'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, rename 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\.staging\rxjs-ccea9159' -> 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\rxjs'
npm ERR!     at destStatted (C:\Users\jweston\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:29:7)
npm ERR!     at C:\Users\jweston\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\.staging\rxjs-ccea9159' -> 'C:\Users\jweston\Documents\Apps\payment-calc-app\node_modules\rxjs'
npm ERR!     at Error (native) parent: 'payment-calc-app' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jweston\AppData\Roaming\npm-cache\_logs\2017-03-23T19_17_36_190Z-debug.log

Package install failed, see above.

我试过 npm clean cache 并以管理员身份运行命令提示符(我在 Windows 上)无济于事.

I've tried npm clean cache and running Command Prompt as an Administrator (I'm on Windows) to no avail.

奇怪的是,当我尝试删除安装失败创建的文件夹时,Windows 阻止我删除它们,并说我需要成为管理员才能删除它们,即使我是管理员.我需要进入每个单独的文件夹并一次删除一个单独的文件.

Oddly enough, when I go to try to delete the folders that the failed installation created, Windows prevents me from deleting them, saying I need to be an Administrator to delete them, even though I am an administrator. I need to go into each individual folder and delete each individual file one at a time.

推荐答案

就我而言,问题是我有另一个运行 'ng serve' 的命令提示符,我停止了该过程并成功完成了创建

In my case the problem was that I had another command prompt with 'ng serve' running, I stopped the process and the creation completed successfully

这篇关于Angular-CLI ng new:“错误:EPERM:不允许操作......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆