Create Angular Project without installing Angular CLI Globally
npx @angular/cli@latest new angular-project
Note:
1. The above mentioned command will prompt
C:\Users\username>npx @angular/cli@latest new angular-project
Need to install the following packages:@angular/cli@21.1.2
Ok to proceed? (y)
You need to provide y to create the project, but it won’t install angular globally.
2. Here angular is not installed globally, so you can’t directly run the application using ng command
C:\Users\username>cd angular-project
C:\Users\username\angular-project>ng serve # this won't work
C:\Users\username\angular-project>npx ng serve # this will work
C:\Users\username\angular-project>npm start # this will work
You need to use npx suffix with all ng command.