DEV Community

Cover image for ng new [in a specific version]
Oliver Erxleben
Oliver Erxleben

Posted on

ng new [in a specific version]

Ever wanted to test out an angular application from a beta version or a release candidate but

ng new [project]
Enter fullscreen mode Exit fullscreen mode

does always use the latest stable? And

ng new --help
Enter fullscreen mode Exit fullscreen mode

doesen`t show up a param to specify a version?

Yeah. Exactly what happened to me. In the post I will share how to do that.

Short Story for the busy devs like me

npm version used: 6.12.1
node version used: v12.12.0

You simply install a specific @angular/cli package using npm (or yarn?). I tested with npm to install angular 9rc:

mkdir angular-9rc
cd angular-9rc
npm install @angular/cli@next
Enter fullscreen mode Exit fullscreen mode

where "next" could be a specific older version or a beta tag you will find on npmjs.com: https://www.npmjs.com/package/@angular/cli

After that you are able to use the local installed version using just

ng new HelloNine
Enter fullscreen mode Exit fullscreen mode

Installation takes quite some time. After all I was able to run the app as usual with

ng serve
ng build
ng build --prod
Enter fullscreen mode Exit fullscreen mode

So with ivy enabled by default? Following documentation: yes it is. Have a look here: https://next.angular.io/guide/ivy

the

ng build --prod 
Enter fullscreen mode Exit fullscreen mode

results in

Results in FireFox

That`s okay, but I think Ivy could get a way smaller. Thanks for reading!

Top comments (0)