Why would you need this? Perhaps you need to build libraries for an old app. This way you can get all of the correct packages (and their peer dependencies) without installing an old version of the CLI globally.
First delete the global version of Angular CLI (this step sucks, I know...)
npm uninstall -g @angular/cliNext use NPX to run any version of the CLI that you need. In this case, version 6.0.1 (Angular v6 has an issue with RXJS, you will need to change the rxjs version from "^6.0.0" to "6.0.0" in packages.json and reinstall it with npm.)
npx -p @angular/[email protected] ng new hello-worldCreate a Component:
cd hello-world
npx ng generate component my-componentAnd build.
npx ng buildCredit to Viacheslav Starikov - I am using his example with the addition of the version tag. https://medium.com/@starikovs/how-to-use-angular-cli-locally-729dbb6707dd
If you need to use angular 6.0.1 for whatever reason - make sure to change the rxjs reference from "rxjs": "^6.0.0" to "rxjs": "6.0.0"