I am trying to generate a new angular project and I noticed that my app.module is not being generated. I have updated node version and npm and everything that could be related but still the app.module is not being generated. I have done this before so I don’t understand what is the problem.
Does anyone else have the same issue?
nvm install –lts
nvm use –lts
nvm alias default ‘lts/*’
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli
And I have tried regenerating multiple projects.
Angular v17 onwards, standalone is default via CLI
This means when you create a new project it won’t have any modules in it
As a workaround it is possible to create a module-based app by using the --no-standalone
flag: ng new --no-standalone
which will create an app.modules.ts in your project
Try using the below command via CLI when generating the module :
ng new myNewApp --no-standalone
First, open command prompt or cmd
And type the word
ng version
and see if you can find an answer
Does it mean that Angular is installed in your system?
If it was installed, you can easily create an Angular project with the simple command
ng new nameApp
If Angular was not installed in your system, you received an error by typing the ng version command in cmd
According to this documentation, coordinate the version of node with the desired angular version and install the command
npm install -g @angular/cli
Angular and create your own project.
Of course, the same problem happened to me once when I wanted to update the Angular version of the system
The commands I gave were executed correctly, but when I typed the ng version command, no output came
I Restarted
the system and it was fixed
I hope it was useful