npm run tsc gives errors.
rjain15 opened this issue · comments
Not sure if this is configuration issue or env issue?
$ npm run tsc
angular2-starter@0.5.0 tsc /Users/rjain/code/ionic-examples/i2/Angular2-JumpStart
tsc --project src --watch
src/app/bootstrap.ts(1,49): error TS2307: Cannot find module 'angular2/angular2'.
src/app/bootstrap.ts(2,74): error TS2307: Cannot find module 'angular2/router'.
src/app/bootstrap.ts(3,32): error TS2307: Cannot find module 'angular2/http'.
src/app/components/app/app-component.ts(1,33): error TS2307: Cannot find module 'angular2/angular2'.
src/app/components/app/app-component.ts(2,48): error TS2307: Cannot find module 'angular2/router'.
src/app/components/customers/customers-component.ts(1,49): error TS2307: Cannot find module 'angular2/angular2'.
src/app/components/customers/customers-component.ts(2,28): error TS2307: Cannot find module 'angular2/router'.
src/app/components/customers/customers-component.ts(3,35): error TS2307: Cannot find module 'angular2/src/core/facade/async'.
src/app/components/filter-textbox/filter-textbox-component.ts(1,64): error TS2307: Cannot find module 'angular2/angular2'.
src/app/components/orders/orders-component.ts(1,40): error TS2307: Cannot find module 'angular2/angular2'.
src/app/components/orders/orders-component.ts(2,28): error TS2307: Cannot find module 'angular2/router'.
src/app/directives/sortby/sortby-directive.ts(1,53): error TS2307: Cannot find module 'angular2/angular2'.
src/app/pipes/capitalize-pipe.ts(1,22): error TS2307: Cannot find module 'angular2/angular2'.
src/app/services/data-service.ts(1,22): error TS2307: Cannot find module 'angular2/http'.
src/app/services/data-service.ts(2,28): error TS2307: Cannot find module 'angular2/angular2'.
message TS6042: Compilation complete. Watching for file changes.
Hi there. I just tried it out from scratch and it seems to be working fine here. Did you go through all of the steps shown in the readme? The errors you're getting make it sound like npm install
wasn't run.
Try also to add following dependencies in the package.json:
"devDependencies": {
"live-server": "^0.8.2",
"typescript": "^1.6.2"
}
and then run "npm install" and "npm run tsc".
That still works great for me with a fresh version of the project (just downloaded and extracted a .zip from github to make sure). Now, I am running it on a Mac and don't have a way at the moment to test on Windows so if you're on Windows let me know.
Hi, I've reproduced rjain's issue
He's using typescript version 1.5.3. Possible solutions:
- update typescript globally using "npm install -g typescript" (or "npm update -g") or
- specify typescript ^1.6.2 in dependencies.
Hi guys,
same issue here, run "npm run tsc" and i get same errors, I'm also using typescript version 1.5.3 and I'm on windows...
If you run the npm install -g
commands shown in the readme (step 1) you should get the latest version of typescript installed on your system.