问题描述
我在 Mac OS 上将 Angular CLI 更新为最新的 @angular/[email protected]
.发出命令 ng new testng7
时,出现此错误:
I updated the Angular CLI to the latest @angular/[email protected]
on a Mac OS. When issuing the command ng new testng7
, I get this error:
Schematic input does not validate against the Schema: {"name":"testng7"}
Errors:
Data path "" should have required property 'version'.
什么也没有创建.任何线索如何修复?
And nothing is created. Any clues how to fix?
推荐答案
首先,为了升级,我是这样做的:
First, to upgrade, I did this:
npm i -g @angular/cli
npm i @angular/cli
全局和本地安装.运行 npm 审计修复
发现 npm 日志中缺少 package.json
存在问题 - 我的根目录中丢失了!所以我在我的主目录中使用以下命令创建了一个:
to install globally and locally. Running an npm audit fix
revealed there is a problem with a missing package.json
in the npm logs - missing from my root directory! So I created one with the following command in my home directory:
npm init --yes
默认的.现在发出一个 ng new projName
有效.
for a default one. Now issuing an ng new projName
works.
这篇关于Schematic 输入不会根据 Schema: {"name":"testng7"} 在 Angular 7 上进行验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!