@angular/cli error when creating project: Unexpected token =

After installing @angular/cli lots of people get this error when trying to create the fist angular project:

SyntaxError: Unexpected token =
   at exports.runInThisContext (vm.js:53:16)
   at Module._compile (module.js:373:25)
   at Object.Module._extensions..js (module.js:416:10)
   at Module.load (module.js:343:32)
   at Function.Module._load (module.js:300:12)
   at Module.require (module.js:353:17)
   at require (internal/module.js:12:17)
   at Object.<anonymous> (C:\Users\a\AppData\Roaming\npm\node_modules\@angular\cli\models\config.js:3:18)
   at Module._compile (module.js:409:26)
   at Object.Module._extensions..js (module.js:416:10)

The solution is very simple, just download and install the newest version of nodejs, this should fix the problem.

Recommended for you

Error: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-ext... If you are facing this error it's because your page is trying to load a local file using file:// or C:/ (you can see it in the URL on your browser). It happened to me one time, that's because I created a HTML page and simply double-clicked on it to open it on the browser, my page was using a JSON fi...
Tutorial: Creating a Realtime Notification System in Angular and Nodejs Notification System Demo In this post I'm going to show you how to create a simple realtime notification system using Angular, Nodejs and Socket.io. It will offer a page where we will be able to create notifications and broadcast it to all the online users. I'll be making it as basic as possible...
Node Express Error: Cannot find module ‘serve-favicon’ This error means you don't have the module 'serve-favicon' installed on your project, here is the full error: Error: Cannot find module 'serve-favicon' at Function.Module._resolveFilename (module.js:542:15) at Function.Module._load (module.js:472:25) at Module.require (module.js:...
How to add Socket.io to an Angular application Lots of people get confused when trying to use Socket.io with Angular, some developers just add the script to the HTML and start using it, even though it works I don't recommend doing this way, let me show you the right way to use it with Angular. After creating your angular project install ng-s...

Leave a Reply

Your email address will not be published. Required fields are marked *

Obs: Use the tag <pre lang="LANGUAGE"> to include code blocks to your comment.
Example: <pre lang="javascript"> console.log('Test'); </pre>