Angular ng新退货软件包安装失败错误-缺少Compiler.umd.js [英] Angular ng new returns package install failed error - compiler.umd.js missing

查看:77
本文介绍了Angular ng新退货软件包安装失败错误-缺少Compiler.umd.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习Angular,并正在关注在线教程.但是,我似乎无法摆脱使用ng new创建一个新项目的麻烦.我在Windows 7上运行节点v10.16.0和npm 6.9.0.在日志中收到以下错误:

I am trying to learn Angular and am following an online tutorial. However, I can't seem to get past creating a new project with ng new. I am running node v10.16.0 and npm 6.9.0 on Windows 7. I get the following error in the log:

15177 verbose cwd C:\Personal documents\Angular\myProject
15178 verbose Windows_NT 6.1.7601
15179 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
15180 verbose node v10.16.0
15181 verbose npm  v6.9.0
15182 error path C:\Personal documents\Angular\myProject\node_modules\.staging\typescript-f4316380\lib\lib.dom.d.ts
15183 error code EPERM
15184 error errno -4048
15185 error syscall unlink
15186 error Error: EPERM: operation not permitted, unlink 'C:\Personal documents\Angular\myProject\node_modules\.staging\typescript-f4316380\lib\lib.dom.d.ts'
15186 error  { [Error: EPERM: operation not permitted, unlink 'C:\Personal documents\Angular\myProject\node_modules\.staging\typescript-f4316380\lib\lib.dom.d.ts']
15186 error   cause:
15186 error    { Error: EPERM: operation not permitted, unlink 'C:\Personal documents\Angular\myProject\node_modules\.staging\typescript-f4316380\lib\lib.dom.d.ts'
15186 error      errno: -4048,
15186 error      code: 'EPERM',
15186 error      syscall: 'unlink',
15186 error      path:
15186 error       'C:\\Personal documents\\Angular\\myProject\\node_modules\\.staging\\typescript-f4316380\\lib\\lib.dom.d.ts' },
15186 error   stack:
15186 error    'Error: EPERM: operation not permitted, unlink \'C:\\Personal documents\\Angular\\myProject\\node_modules\\.staging\\typescript-f4316380\\lib\\lib.dom.d.ts\'',
15186 error   errno: -4048,
15186 error   code: 'EPERM',
15186 error   syscall: 'unlink',
15186 error   path:
15186 error    'C:\\Personal documents\\Angular\\myProject\\node_modules\\.staging\\typescript-f4316380\\lib\\lib.dom.d.ts',
15186 error   parent: '@angular-devkit/build-optimizer' }
15187 error The operation was rejected by your operating system.
15187 error It's possible that the file was already in use (by a text editor or antivirus),
15187 error or that you lack permissions to access it.
15187 error
15187 error If you believe this might be a permissions issue, please double-check the
15187 error permissions of the file and its containing directories, or try running
15187 error the command again as root/Administrator (though this is not recommended).
15188 verbose exit [ -4048, true ]

我遵循上面指定的路径,并且lib文件夹为空.我尝试重新安装节点,重新安装角度,用--force清除缓存,以管理员身份运行,然后重新启动.没有任何帮助.

I followed the path specified above and the lib folders are empty. I tried reinstalling node, reinstalling angular, clearing the cache with --force, running as administrator, restarting. Nothing is helping.

请注意,我是一个完全菜鸟,只是想学习该框架,目前看来无法使用它.

Please note that I am a complete noob at this and am just trying to learn the framework, which right now seems impossible to work with.

我希望这些软件包能够安装并且项目创建不会出现问题.

I expect the packages to install and the project to be created without issues.

推荐答案

由于某些原因,当angular/cli(ng)自行运行npm install时,它在编写软件包方面存在问题,因此您可以运行

For some reasons when angular/cli (ng) run npm install by itself, it have problem with packages writing, so you can run

ng new yourProject --skipInstall=true

因此angular/cli将不会安装任何节点软件包,然后再运行

so angular/cli will not install any node packages and then run

npm install --force

自行安装

这篇关于Angular ng新退货软件包安装失败错误-缺少Compiler.umd.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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