Mithun Shreevatsa
Mithun Shreevatsa

Reputation: 3609

SyntaxError: Unexpected token angular-cli

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

enter image description here

Except 2 warning at last, everything was installed successfully

enter image description here

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:

enter image description here

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

Answers (1)

Nikki Kononov
Nikki Kononov

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

Related Questions