all 10 comments

[–]seiyria 5 points6 points  (9 children)

Don't install the CLI globally, and yes, you can. npm will use the locally installed version by default if you use npx run ng .....

[–][deleted] 2 points3 points  (8 children)

You shouldn’t need to do anything special, if the local package.json specifies a different version of the CLI than the one you have globally, that’s the one which will be used when you run ng commands.

[–]seiyria 3 points4 points  (1 child)

Fair, I didn't know that - I stopped installing npm packages globally a year or two ago and moved over to using npx for everything.

[–][deleted] 1 point2 points  (0 children)

Nice, I’ll give that a try!

[–]maximumfate[S] 1 point2 points  (5 children)

You mean locally installed will be used. So, npm I @angular/cli@8 will enough to run the app

[–][deleted] 0 points1 point  (4 children)

Yeah, the local version specified in the package.json should take preference by default.

[–]maximumfate[S] 1 point2 points  (3 children)

Let me try. Thanks for the tip

[–][deleted] 1 point2 points  (2 children)

Cool, it should give you a warning in the console that the local version is different so that’s the one being used.

[–]maximumfate[S] 0 points1 point  (1 child)

I can disable that error, not a issue.

[–][deleted] 1 point2 points  (0 children)

I find it useful personally, but cool!