The specified command add is invalid. For available options, see ng help
.
What could be wrong?
You will need to update your Angular cli and Angular. Please read all of this before copy and pasting the commands into terminal.
The latest version for these are (as of writing this post):-
Once you have update Angular to greater than version 6 you should be able to use the ng add
command.
In order to update the angular-cli package installed globally in your system, you need to run:
npm uninstall -g angular-cli
npm cache clean or npm cache verify
npm install -g @angular/cli@latest
You will also need to update it within your project
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install
As your CLI version is still on 1.x you need to convert your angular-cli.json to angular.json, which you can do with the following command:
ng update @angular/cli --from=1.7.4 --migrate-only
I hope you find this helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With