0

When I try to create a new project with Angular CLI, with:

ng n app

I get this error:

C:\Users\Venkateshwarn 
M\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng:26
                  );
                  ^
SyntaxError: Unexpected token )
     at createScript (vm.js:56:10)
     at Object.runInThisContext (vm.js:97:10)
     at Module._compile (module.js:542:28)
     at Object.Module._extensions..js (module.js:579:10)
     at Module.load (module.js:487:32)
     at tryModuleLoad (module.js:446:12)
     at Function.Module._load (module.js:438:3)
     at Module.runMain (module.js:604:10)
     at run (bootstrap_node.js:390:7)
     at startup (bootstrap_node.js:150:9)

How can I upgrade or uninstall Angular CLI?

Elikill58
  • 4,050
  • 24
  • 23
  • 45

2 Answers2

0

To uninstall angular cli you can use this command:

npm uninstall -g @angular/cli
npm cache clean

you can refer this article to get more knowledge: https://www.npmjs.com/package/@angular/cli

To upgrade angular

Perform a basic update to the current stable release:

ng update @angular/cli @angular/core

To update from one major version to another:

ng update @angular/cli@^<major_version> @angular/core@^<major_version>

you can refer this article to get more: https://angular.io/cli/update

-1

It should be solved by reinstalling Nodejs and Angular ClI, first of all uninstall both, and at the end of the reinstallation update Angular CLI.

Willy Andreu
  • 109
  • 4