简体   繁体   English

包安装失败 - 使用 CLI 创建新的 Angular 应用程序

[英]Package install failed - creating new Angular app using CLI

I am creating a new Angular app using CLI, got the error as shown below.我正在使用 CLI 创建一个新的 Angular 应用程序,得到如下所示的错误。

Command run命令运行

C:\Angular>ng new hello-world
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS

Error错误

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 version 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 version NPM 版本

C:\Users\e5544251>npm -v
6.13.4

I have deleted the existing folder and try the same command again it got succeded.我删除了现有文件夹并再次尝试相同的命令,它成功了。

C:\\Angular>ng new hello-world

C:\Angular>ng new hello-world
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
CREATE hello-world/angular.json (3606 bytes)
CREATE hello-world/package.json (1244 bytes)
CREATE hello-world/README.md (1027 bytes)
CREATE hello-world/tsconfig.json (489 bytes)
CREATE hello-world/tslint.json (3125 bytes)
CREATE hello-world/.editorconfig (274 bytes)
CREATE hello-world/.gitignore (631 bytes)
CREATE hello-world/browserslist (429 bytes)
CREATE hello-world/karma.conf.js (1023 bytes)
CREATE hello-world/tsconfig.app.json (210 bytes)
CREATE hello-world/tsconfig.spec.json (270 bytes)
CREATE hello-world/src/favicon.ico (948 bytes)
CREATE hello-world/src/index.html (296 bytes)
CREATE hello-world/src/main.ts (372 bytes)
CREATE hello-world/src/polyfills.ts (2835 bytes)
CREATE hello-world/src/styles.css (80 bytes)
CREATE hello-world/src/test.ts (753 bytes)
CREATE hello-world/src/assets/.gitkeep (0 bytes)
CREATE hello-world/src/environments/environment.prod.ts (51 bytes)
CREATE hello-world/src/environments/environment.ts (662 bytes)
CREATE hello-world/src/app/app.module.ts (314 bytes)
CREATE hello-world/src/app/app.component.html (25725 bytes)
CREATE hello-world/src/app/app.component.spec.ts (957 bytes)
CREATE hello-world/src/app/app.component.ts (215 bytes)
CREATE hello-world/src/app/app.component.css (0 bytes)
CREATE hello-world/e2e/protractor.conf.js (808 bytes)
CREATE hello-world/e2e/tsconfig.json (214 bytes)
CREATE hello-world/e2e/src/app.e2e-spec.ts (644 bytes)
CREATE hello-world/e2e/src/app.po.ts (301 bytes)
√ Packages installed successfully.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM