1

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?

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, i managed to upgrade to latest node version and it got resolved. But its all a workaround for me to re-install all global node modules
Well you can see what packages you have installed globally by running npm -g ls --depth=0 and then reinstall all the packages that came up.
According to a post made here you can use angular-cli with node version 4.4.x or higher. (note: angular-cli !== @angluar-cli)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.