Setup a local development environment
Setting up a new project on your machine is quick and easy with the QuickStart seed, maintained on github.
main.ts application files (described below) that facilitate richer application examples.
Make sure you have node and npm installed. Then ...
- Create a project folder (you can call it
quickstartand rename it later).
- Clone or download the QuickStart seed into your project folder.
- Install npm packages.
npm startto launch the sample application.
Perform the clone-to-launch steps with these terminal commands.
Download the QuickStart seed and unzip it into your project folder. Then perform the remaining steps with these terminal commands.
What's in the QuickStart seed?
The QuickStart seed contains the same application as the QuickStart playground. But it's true purpose is to provide a solid foundation for local development. Consequently, there are many more files in the project folder on your machine, most of which you can learn about later.
Focus on the following three TypeScript (
.ts) files in the
All guides and cookbooks have at least these core files. Each file has a distinct purpose and evolves independently as the application grows.
Defines the same
Compiles the application with the JIT compiler and bootstraps the application to run in the browser. That's a reasonable choice for the development of most projects and it's the only viable choice for a sample running in a live-coding environment like Plunker. You'll learn about alternative compiling and deployment options later in the documentation.
If you're new to Angular, we recommend staying on the learning path.
Appendix: node and npm
Get them now if they're not already installed on your machine.
Verify that you are running node
v4.x.x or higher and npm
3.x.x or higher
by running the commands
node -v and
npm -v in a terminal/console window.
Older versions produce errors.
We recommend nvm for managing multiple versions of node and npm. You may need nvm if you already have projects running on your machine that use other versions of node and npm.
Appendix: Why develop locally
Links on almost every documentation page open completed samples in the browser. You can play with the sample code, share your changes with friends, and download and run the code on your own machine.
The QuickStart shows just the
It creates the equivalent of
main.ts internally for the playground only.
so the reader can discover Angular without distraction.
The other samples are based on the QuickStart seed.
As much fun as this is ...
- you can't ship your app in plunker
- you aren't always online when writing code
- transpiling TypeScript in the browser is slow
- the type support, refactoring, and code completion only work in your local IDE
For real development, we strongly recommend developing locally.