Node.js and npm are essential to Angular development.
Get it now if it's not already installed on your machine.Verify that you are running at least node v4.x.x
and npm 3.x.x
by running node -v
and npm -v
in a terminal/console window.
Older versions produce errors.
Clone this repo into new project folder (e.g., my-proj
).
We've captured many of the most useful commands in npm scripts defined in the package.json
:
npm start
- runs the compiler and a server at the same time, both in "watch mode".npm run build
- runs the TypeScript compiler once.npm run build:w
- runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them.npm run serve
- runs the lite-server, a light-weight, static file server with excellent support for Angular apps that use routing.
Here are the test related scripts:
npm test
- compiles, runs and watches the karma unit testsnpm run e2e
- compiles and run protractor e2e tests, written in Typescript (*e2e-spec.ts)
- In command prompt, Go to the installed directory.
- Enter npm start.
- The application runs in 'localhost:3000'