0

I have just started the angular.io tutorial, tour of heroes (tutorial)

I have encountered a compilation error which I was not able to locate in the code. So I decided to download the complete example and it did not work.

  • copy and pasted existing folder "angular-tour-of-heroes" (so I can keep my original code intact for future reference) and renamed like "angular-tour-of-heroes2".
  • unzipped , overwrote complete code to the folder
  • and there came an error

that I have to be in a project folder

and which I am! After that I tried some other example locally, and it did not work as well.

My finding is so far, angular only works on the folder created through CLI. meaning you have to install "Ng new folder" for any small project even simple sample code for practice?

Am I right?

Dale K
  • 25,246
  • 15
  • 42
  • 71

1 Answers1

0

The downloaded, complete example of the Tour of Heroes does not contain the required node modules to run the solution. These are generally excluded to reduce the size of the source and typically wouldn't be source controlled either.

There are however arguments for source controling them but I wouldnt worry about that just yet

You can install packages using npm install and you'll see a node_modules folder created containing all the required packages.

Darren Lamb
  • 1,535
  • 14
  • 18