WebStorm:新的 AngularCli 项目:错误:目录应与格式“路径"匹配; [英] WebStorm: New AngularCli Project: Error: directory should match format "path"

查看:26
本文介绍了WebStorm:新的 AngularCli 项目:错误:目录应与格式“路径"匹配;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试创建一个新的 Angular Cli 项目时:

When I try to create a new Angular Cli project:

在 IDE 执行 ng new angularcli --dir=. 命令几秒钟后收到此消息(在 运行 窗口中):

receive this message (in Run window) after a few seconds after executing ng new angularcli --dir=. command by IDE:

"C:\Program Files\nodejs\node.exe" C:\Users\I\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng new angularcli --dir=.
Error: Schematic input does not validate against the Schema: {"directory":".","name":"angularcli","skipGit":false,"style":"css","version":"1.7.3","commit":{"message":"chore: initial commit from @angular/cli\n\n    _                      _                 ____ _     ___\n   / \\   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|\n  / △ \\ | '_ \\ / _\\` | | | | |/ _\\` | '__|   | |   | |    | |\n / ___ \\| | | | (_| | |_| | | (_| | |      | |___| |___ | |\n/_/   \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_|       \\____|_____|___|\n               |___/\n","name":"Angular CLI","email":"angular-cli@angular.io"},"path":"app","sourceDir":"src","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","skipTests":false,"skipInstall":false,"linkCli":false,"minimal":false,"serviceWorker":false}
Errors:
  .directory should match format "path"
Schematic input does not validate against the Schema: {"directory":".","name":"angularcli","skipGit":false,"style":"css","version":"1.7.3","commit":{"message":"chore: initial commit from @angular/cli\n\n    _                      _                 ____ _     ___\n   / \\   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|\n  / △ \\ | '_ \\ / _\\` | | | | |/ _\\` | '__|   | |   | |    | |\n / ___ \\| | | | (_| | |_| | | (_| | |      | |___| |___ | |\n/_/   \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_|       \\____|_____|___|\n               |___/\n","name":"Angular CLI","email":"angular-cli@angular.io"},"path":"app","sourceDir":"src","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","skipTests":false,"skipInstall":false,"linkCli":false,"minimal":false,"serviceWorker":false}
Errors:
  .directory should match format "path"
Done

在 Mac 上类似:

似乎与命令的这一部分有关:--dir=..但我不知道为什么以及如何纠正它!

It seems to be relevant to this part of the command: --dir=.. But I don't know why and how to correct it!

(我知道我可以通过命令行独立创建一个新项目,然后在 WebStorm 中打开它,但由于某些原因不想这样.)

推荐答案

这是一个已知的 cli 1.7.x 问题 - https://github.com/angular/angular-cli/issues/9655;不幸的是,到目前为止,我们一直无法修复它......我们正在与 Angular 团队合作解决这个问题,请关注 WEB-31291 获取更新.作为一种解决方法,您可以尝试使用 ng new 在终端中创建新的 angular 应用程序,然后在 WebStorm 中打开生成的项目文件夹

it's a known cli 1.7.x issue - https://github.com/angular/angular-cli/issues/9655; unfortunately we have been unable to fix it on our end so far... We are working with Angular team on this, please follow WEB-31291 for updates. As a workaround, you can try creating new angular app in terminal using ng new <project_name> and then opening the generated project folder in WebStorm

这篇关于WebStorm:新的 AngularCli 项目:错误:目录应与格式“路径"匹配;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆