1

I am new to Angular2. I don't have any clear idea about angular. I have few doubts in this technology.

1) How can we set up Angular2 project in local machine?

2) For local setup do we need Angular CLI or we can use other method?

3) what is the best method to create Angular2 environment ?

Now I installed angular CLI, but when i use ng new <application-name> I am getting the following error.

\node_modules\@ngtools\json-schema\src\schema-class-factory.js:34
            result.push(...indices);
                        ^^^

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)

Please suggest the best tutorial for learning Angular2

Alekya
  • 239
  • 5
  • 15
Team
  • 347
  • 1
  • 5
  • 16
  • 2
    Use [this](https://angular.io/docs/ts/latest/quickstart.html) site for a quickstart. – Koby Douek Mar 08 '17 at 07:27
  • alternatively you can use [**this**](http://stackoverflow.com/questions/41569920/how-to-setup-the-environment-for-angular-2-0/41570168#41570168) as well – Aravind Mar 08 '17 at 07:35
  • You can use Visual Studio code for your editor, it includes npm which we need to install all required packages. For a quick setup, you can download the .zip here: https://github.com/angular/quickstart. Extract it and open the folder using Visual Studio code. Open the terminal to type `npm install` and then `npm start`, you should see your sample Angular application running on a browser. – samAlvin Mar 08 '17 at 07:37
  • follow this one: https://angular.io/docs/ts/latest/guide/webpack.html – Jai Mar 08 '17 at 07:38

1 Answers1

0

I was receiving this exact same error. I found this question first when trying to solve the issue, but there was no associated answer. I did some searching and found:

https://github.com/angular/angular-cli/issues/1946

where a number of users stated updating node solved the issue. Which lead me to:

How do I update node and npm on windows?

Which states the best ay to upgrade node is to download a new MSI and run it, so I went to:

https://nodejs.org/en/

Ran the install which updated node, then back in my command prompt reran:

ng new

and eventually received:

Project '<application-name>' successfully created.

Jason D.
  • 390
  • 3
  • 11