Angular 9 ng new myapp 给出错误原理图工作流失败

Lij*_*iel 24 node.js npm angular angular9

我安装了 angular 9

Angular CLI:9.0.1 节点:13.8.0 操作系统:win32 x64

角度:...常春藤工作区:

套餐版本

@angular-devkit/architect 0.900.1
@angular- devkit /core 9.0.1
@angular-devkit/schematics 9.0.1
@schematics/angular 9.0.1
@schematics/update 0.900.1
rxjs 6.5.3

每次我尝试使用 ng new 创建一个新项目时,我都会收到消息

安装包... npm WARN deprecated request@2.88.2: request 已被弃用,参见https://github.com/request/request/issues/3142 npm ERR!解析 '...pm-signature":"-----B' npm ERR 附近时,JSON 输入意外结束!可以在以下位置找到此运行的完整日志:npm ERR!C:\Users\Lijo John Daniel\AppData\Roaming\npm-cache_logs\2020-02-12T09_52_57_342Z-debug.log × 包安装失败,见上。原理图工作流失败。看上面。

我尝试重新安装 angular 甚至 node,但问题仍然存在

我的操作系统版本是 Win 10 v.1909 build 18363.592。有人可以帮我弄这个吗?

Abo*_*zlR 15

首先,验证您的 NPM 缓存内存

npm cache verify
Run Code Online (Sandbox Code Playgroud)

然后尝试:

npm cache clean --force
npm install –g @angular/cli@latest 
ng new <YourProjectName>
Run Code Online (Sandbox Code Playgroud)

如果问题仍然存在,请尝试以下操作

npm cache clean --force
npm update
ng new <YourProjectName>
Run Code Online (Sandbox Code Playgroud)
笔记
正如@0210vidit 在下面的评论中所说:

不要在命名中使用破折号 (-) 或 (.)


小智 13

尝试使用以下方法清理npm 缓存:

npm cache clean --force
Run Code Online (Sandbox Code Playgroud)

那么它现在应该可以工作了,

ng new my-app
Run Code Online (Sandbox Code Playgroud)


小智 8

我有类似的问题,安装纱线或清除缓存没有帮助。我从我的应用程序名称中删除了“-”并且它起作用了

错误 :

ng new first-app
Run Code Online (Sandbox Code Playgroud)

解决了:

ng new firstapp
Run Code Online (Sandbox Code Playgroud)

希望能帮助到你。


小智 6

Angular 9 报告了此问题,并且多个地理位置都面临此问题。参考https://github.com/angular/angular-cli/issues/16944

要继续,您可以通过以下步骤将 Angular 版本升级到 8

ng--版本

npm 卸载 -g @angular/cli

npm 缓存清理 --force

npm install -g @angular/cli@8.0.0

ng--版本


小智 5

我从昨天开始就遇到这个问题,尝试了所有这些方法,但没有成功。然后我安装了yarn,并通过运行此命令配置了角度cli以使用yarn作为包管理器 ng config -g cli.packageManager yarn,并且它起作用了。


Abd*_*Ali 0

作为临时修复,您可以直接从 GitHub 手动安装“error-ex”模块,然后安装此处提到的依赖项 facebook/create-react-app#8465 (评论)

$ npm 我https://github.com/Qix-/node-error-ex

$ npm 我