0
votes

Is there a way to run the Angular 2 startup project https://github.com/angular/quickstart/blob/master/README.md without having to run NPM or Node? I don't mind using NPM to download the packages, but I don't want to have to run the server to run the project. Is there a way to separate the two?

I have spent about an hour looking for a reasonable answer and seem to come up short. Any help is greatly appreciated.

2
The quickstart can be served by apache without node's help as any html/js files. npm install then npm run tsc will install dependencies and compiles ts without starting a server.user3802077

2 Answers

1
votes

You'll definitely need to run npm install to download the dependencies. As for doing it without running the server, the application makes numerous XHR calls to be able to function and your browser might need special setup to do this. ie. In Chrome for OSX you'll need to launch Chrome through the terminal like this open /Applications/Google\ Chrome.app --args --allow-file-access-from-files. You'll also need to use the typescript compiler by running it in in watch mode (using npm run tsc:w) or by invoking it manually by running tsc everytime you want to compile your changes.

1
votes

If you are using WebStorm you don't need a server. Just right click index.html and select "Run index.html". It will then start its internal web server and load the app.

Other IDEs might also support this.