Reputation: 3609
node version in use: v5.7.0
.
Trying install/upgrade angular-cli to latest version to support: angular-4
Upgraded npm to latest version using powershell as recommended by node team.
npm version in use after upgrade is: 4.5.0
(latest)
Later tried to install angular-cli using: npm install -g @angular/cli
Except 2 warning at last, everything was installed successfully
But when i just type in ng
or ng help
: I get error as:
SyntaxError: Unexpected token =
which is pointing to fallbacks argument in constructor function like this:
Instead of upgrading just npm
, should we update node version as specified in: https://github.com/angular/angular-cli#prerequisites?
Or am i missing something?
Upvotes: 1
Views: 3029
Reputation: 549
You are running an outdated version of the node. You should have node 6.9.0 as per wiki
Angular CLI can now be found on NPM under @angular/cli instead of angular-cli, and has a minimum requirement of Node 6.9.0 or higher, together with NPM 3 or higher.
https://github.com/angular/angular-cli/wiki/stories-1.0-update
That could be related to the problem of updating angular.
I suggest using chocolatey package manager to update nodejs https://chocolatey.org/
Alternatively, you can always go to nodejs website and download latest version.
Upvotes: 4