My motive is to create a UI library of my own using Angular 9. I was going through the Angular official documentation about Creating Libraries. They started with this command:

ng new my-workspace --create-application=false

And they say that --create-application=false will instruct the CLI to create the config file only and not the application code. Out of curiosity I created 2 projects one with this parameter and other one I generated normally with ng new my-project just to see what is the difference between project structure. I'm confused to see both are same.

Left one is without parameter while Right one is with parameter:enter image description here

Please correct my mistake.

My versions are:

Angular CLI: 6.2.9

Node: 10.19.0

OS: linux x64

Here is a recording of my steps: https://youtu.be/wsedP3DAsl4

4

Best Answer


The --create-application flag is used with the ng new command. Settingthis to false tells ng new not to create the initial Angularapplication in the Workspace. By default this flag is set to true tomatch the behavior of the previous versions of Angular CLI.

More info at this Medium blog post: Angular In Depth

So the difference is that you can create multiple 'projects' that share the same workspace instead of having one workspace for each project that would mean having one node_modules folder and so on..

I'm using Angular CLI: 15.2.4, so, in order to work the command I used ng new myApp --create-application=false and works.

C:

Look I had this error Error: Unknown argument: createApplication then what I do is use sudo like this sudo ng new my-workspace --createapplication=false and it works.

maybe resolve your problem:

  • ng new my-workspace --skip-install

  • Remove ./src

  • ng generate application [name] --style=[name] --routing=[boolean]