Combining steps to fix with the process explanation. Follow the numbered fixes to fix the configuration.
* Solution based on npm
as used in the official Angular 2 guide.
Angular 2 plunker link redirected me to an Angular 2 QuickStart example (which is different from Plunker's Angular 2 template - FYI).
I downloaded Plunker's project, as Adi99 did.
I then tried following the steps in Angular's QuickStart setup but failed on npm install
.
Error: ENOENT: no such file or directory, open '/home/alik/Dev/help2/package.json'
.
Fix step 1: Download package.json
from Angular 2 QuickStart source code, put it in the root's project folder and change in the file src
with .
.
Running npm install
now passes successfully, probably downloading all the necessary dependencies.
The next step in the QuickStart tutorial is to run npm start
which fails on error TS5057: Cannot find a tsconfig.json file at the specified directory: './'
.
Fix step 2: Download tsconfig.json
from Angular 2 QuickStart source code and put it in the root's project folder..
Running npm start
now passes successfully, creating the server and opening a browser page with the address http://localhost:3000/
, rendering Angular 2 code successfully with the message:
Hello Angular
Hope this helped and Angular team :) will make the initial configuration easier. It's a bad architecture to have lots of configuration files. Hard to understand what's needed, why and how to change it.
For example, in Angular's QuickStart source project, there are 10 configuration files: bs-config.e2e.json
, bs-config.json
, karma-test-shim.js
, karma.conf.js
, package.json
, protractor.config.js
, tslint.json
, src/systemjs.config.extras.js
, src/systemjs.config.js
, src/tsconfig.json