Previously we passed `--no-bin-links` because we used to install packages globally in some cases. But now this is no longer needed as we should now have permissions to generate "local" bin links even during a temp installations as these will no longer generate bin links in the global context.
Fixes#16133
In the case users don't have analytics globally configured when the CLI will self update during ng update. It will prompt to configure this.
However, afterwards the update will fail with `Repository is not clean. Please commit or stash any changes before updating.` as there would be uncommited local changed.
With this change we now check if the current CLI version is the latest published version. If it is not, we install a temporary version to run the `ng update` with.
With this change the CLI offers a way for a package authors to specify if during `ng add` the package should be saved as a `dependencies`, `devDependencies` or not saved at all.
Such config needs to be specified in `package.json`
Example:
```json
"ng-add": {
"save": false
}
```
Possible values are;
- false - Don't add the package to `package.json`
- true - Add the package to the `dependencies`
- `dependencies` - Add the package to the `dependencies`
- `devDependencies` - Add the package to the `devDependencies`
Closes#12003 , closes#15764 and closes#13237
Node.js 8 is now in maintenance LTS status and will be EOL in December 2019. Node.js 10 is now the active LTS version with Node.js 12 due for arrival in April 2019. Node.js 10+ provides an improved performance baseline as well as access to newer Node.js APIs and Javascript language features which the Angular CLI will now be able to leverage.
If no version specifier is supplied `ng add` will now try to find the most recent version of the package that has peer dependencies that match the package versions supplied in the project's package.json
This should clean up the code a bit.
Note: at first I added the no-useless-cast rule, but after getting frustrated
with it (as it has many false positive), I decided to remove the rule but some
useless casts were removed so I let those in the PR.