Reputation: 121
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release, which will only support Node 6.9 and greater. This package will be officially deprecated shortly after.
Upvotes: 11
Views: 9696
Reputation: 1
This happens because there is incompatibility with the local and global version of your Angular, it is recommended to uninstall and then install.
to uninstall and then clear the cache
npm uninstall -g angular-cli npm uninstall --save-dev angular-cli
then we install the latest version globally and then locally to be able to use ng without problems
Install globally npm install -g @ angular / cli Install locally npm install @ angular / cli
then you check with "ng --version" if you have everything updated, with that you can use for example the "ng add @ angular / material" without problems.
Upvotes: 0
Reputation: 1
use node version that angular 2 supports.
i have used portable node-v6.17.1-win-x64 zip and by setting set path=extracted-node-v6.17.1-win-x64-folder
make sure node version is according to portable version or existing node version 6 will work.
Upvotes: -1
Reputation: 1011
You have to run below command:
npm install -g @angular/cli@latest
Upvotes: 18