6

When I try to create a new Angular Cli project:

enter image description here

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

Similarly on Mac: enter image description here


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

(I know that I can create a new project via command line independently and then open it in WebStorm, but don't want this for some reasons.)

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
  • 3
    *"It seems to be relevant to this part of the command: `--dir=.`"* That's correct assumption. https://github.com/angular/angular-cli/issues/9655 . On WebStorm side -- follow this ticket: https://youtrack.jetbrains.com/issue/WEB-31291 – LazyOne Mar 29 '18 at 09:18

4 Answers4

8

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

lena
  • 90,154
  • 11
  • 145
  • 150
1

Do not include project name special characters. for example this is wrong: www_testProject.

This is correct: wwwTestProject

Onur İnci
  • 118
  • 1
  • 8
0

I have this issue, But I got a solution which is works for me is:

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.

Invalid- new_something

Valid- new-something

Shubham Verma
  • 8,783
  • 6
  • 58
  • 79
0

According to my last test, there is no problem. I upgraded my tools (Angular CLI v7.1.4 and WebStorm v2018.3.2):

enter image description here

enter image description here

Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100