WebStorm: New AngularCli Project: Error: directory should match format "path"

WebStorm: New AngularCli Project: Error: directory should match format "path"

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

运行window在IDE执行ng new angularcli --dir=.命令几秒后收到此消息:

"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=.。但是我不知道为什么以及如何纠正它!

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

这是一个已知的 cli 1。7.x 问题 - 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 需要更新。 作为解决方法,您可以尝试使用 ng new <project_name> 在终端中创建新的 angular 应用程序,然后在 WebStorm

中打开生成的项目文件夹

我有这个问题,但我得到了一个适合我的解决方案:

New project names must start with a letter, and must contain only alphanumeric characters or dashes. When adding a dash the segment after the dash must also start with a letter.

无效-new_something

有效-new-something

不包含项目名称特殊字符。例如这是错误的:www_testProject.

这是正确的:wwwTestProject

根据我上次的测试,没有问题。我升级了我的工具(Angular CLI v7.1.4 和 WebStorm v2018.3.2):