Make sure Node.js and NPM are up to date. If not, then run the following:
Get the latest node.js (to keep ng2 CLI happy).
nvm install node
nvm use 7.5.0
or whichever is the latest at the time.
Update npm.
npm install -g npm
Then run npm install
to install dependencies.
Run ng serve --host 0.0.0.0 --port 8080 --live-reload-port 8081
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files. If you need to change ports and such, use ng serve --host 0.0.0.0 --port 8080 --live-reload-port 8081
and then navigate to http://localhost:8080/
to view the site.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build.