ng new 出现错误,应该匹配格式为 “html-selector”

当试图创建Angular项目时,出现了错误。

$ ng new angular_onsen

? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SASS   [ http://sass-lang.com   ]
Schematic input does not validate against the Schema: {"name":"angular_onsen","version":"7.1.4","routing":true,"style":"sass"}
Errors:

  Data path ".name" should match format "html-selector".

据说项目名称不能使用下划线。

$ ng new angular-onsen

? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SASS   [ http://sass-lang.com   ]
CREATE angular-onsen/README.md (1029 bytes)
CREATE angular-onsen/angular.json (3922 bytes)
CREATE angular-onsen/package.json (1312 bytes)
CREATE angular-onsen/tsconfig.json (435 bytes)
CREATE angular-onsen/tslint.json (2824 bytes)
CREATE angular-onsen/.editorconfig (246 bytes)

完成了!

广告
将在 10 秒后关闭
bannerAds