Search code examples
angularjsintellij-ideaintellij-plugin

angular directory structure not getting created in IntelliJ


I am following steps in IntelliJ to support Angular.

https://www.jetbrains.com/help/idea/2017.1/using-angular.html#install_angular_cli

In Generating an Angular application stub using Angular CLI section, I have to specify some package_name for Angular CLI field while setting up the project. What should be the value of package_name? I keep getting the following message but the angular directory structure doesn't get created.

"C:\Program Files\nodejs\node.exe" C:...\AppData\Roaming\npm\node_modules\angular-cli\bin\ng new angularIntelliJ8 --dir=. As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release, which will only support Node 6.9 and greater. This package will be officially deprecated shortly after. To disable this warning use "ng set --global warnings.packageDeprecation=false". Directory '.' already exists. Done

I have specified the path as C:\Users\Manu\AppData\Roaming\npm\node_modules\angular-cli

I notice that if I run ng new angularIntelliJ8 on cmd then the angular directory structure gets created. But doing where ng shows the following path for ng

>where ng
C:\..\AppData\Roaming\npm\ng
C:\..\AppData\Roaming\npm\ng.cmd

If I use above paths in Angular CLI, I get error that IntelliJ couldn't find bin/ng

Also, if I run '"C:\Program Files\nodejs\node.exe" C:\Users\Manu\AppData\Roaming\npm\node_modules\angular-cli\bin\ng new angularIntelliJ10' on cmd terminal manually (without --dir=.), the structure gets created.

Am I specifying wrong path for Angular CLI?


Solution

  • Please update angular-cli to the most recent version (see Updating Angular CLI for instructions). Both the package name/location and CLI interface have changed since beta 28, and IDEA 2017.1.* only supports new cli versions.

    Once you have a new cli package installed, specify C:\Users\Manu\AppData\Roaming\npm\node_modules\@angular\cli as a package name in New Project wizard