【发布时间】:2020-09-12 14:40:39
【问题描述】:
我正在使用 CLI 创建一个新的 Angular 应用程序,得到如下所示的错误。
命令运行
C:\Angular>ng new hello-world
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
错误
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Angular\hello-world\node_modules\regexp.prototype.flags\node_modules\es-abstract
npm ERR! dest C:\Angular\hello-world\node_modules\regexp.prototype.flags\node_modules\.es-abstract.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Angular\hello-world\node_modules\regexp.prototype.flags\node_modules\es-abstract' -> 'C:\Angular\hello-world\node_modules\regexp.prototype.flags\node_modules\.es-abstract.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\e5544251\AppData\Roaming\npm-cache\_logs\2020-09-12T14_13_39_206Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
Agular CLI 版本
C:\Users\e5544251>ng v
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 9.1.7
Node: 12.14.0
OS: win32 x64
Angular:
...
Ivy Workspace:
Package Version
------------------------------------------------------
@angular-devkit/architect 0.901.7
@angular-devkit/core 9.1.7
@angular-devkit/schematics 9.1.7
@schematics/angular 9.1.7
@schematics/update 0.901.7
rxjs 6.5.4
C:\Users\e5544251>
NPM 版本
C:\Users\e5544251>npm -v
6.13.4
【问题讨论】:
-
你的 npm 版本是最新的吗?
-
@Sandrin Joy
npm version-6.13.4 -
在这种情况下,我经常清理 npm 缓存。你可以试试
npm cache clean或npm cache verify吗? -
您是否在 nodejs 项目中创建 Angular 应用程序?
-
@Sandrin Joy,我不确定你的评论
标签: angular angular-cli