Mir-Ismaili
Mir-Ismaili

Reputation: 16988

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

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":"[email protected]"},"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":"[email protected]"},"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.)

Upvotes: 6

Views: 3917

Answers (4)

Mir-Ismaili
Mir-Ismaili

Reputation: 16988

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

Upvotes: 0

Onur İnci
Onur İnci

Reputation: 116

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

This is correct: wwwTestProject

Upvotes: 1

Shubham Verma
Shubham Verma

Reputation: 9933

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

Upvotes: 0

lena
lena

Reputation: 93748

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

Upvotes: 8

Related Questions