Using local install of angular cli

I don't really like to install the npm packages globally. The docs suggest using the global flag to install @angular/cli but I installed it locally thinking this is like all other docs that only do this for convenience. Now the problem here is that to create a new angular project you need to use the npx ng new <directory-name> command. but I can't specify the current directory where the angular cli is installed npx ng new ./ doesn't work but npx ng new practice-project does. I took a look at the docs and didn't see a way. https://angular.dev/cli/new
Angular
The web development framework for building modern apps.
3 Replies
Ganesh
GaneshOP2mo ago
I guess I am looking for something like vite has with npm create vite@latest -- --template react so maybe npm create @angular/cli@latest new <project-dir> will work too nope that doesn't. I thought npm init/create downloaded a package in memory then executed specified commands against it but doesn't seem to be the case
Ganesh
GaneshOP2mo ago
No description
Ganesh
GaneshOP2mo ago
okayy it appends create before the package name so npm init @angular/cli is executing npm exec @angular/create-cli https://www.npmjs.com/package/@angular/create also found out they have this not mentioned in the docs dammit

Did you find this page helpful?