New --v2 --t2 project through and error

Hi All,

starting a new project --v2 --ts from the latest Ionic2

ionic start MyIonic2Project tutorial --v2 --ts

I’m getting this error:

✗ TypeScript error: /Users/sebas/dev/tests/ionic2/MyIonic2Project/node_modules/angular2/src/facade/promise.d.ts(1,10): Error TS2661: Cannot re-export name that is not defined in the module.

here is my env:

(19:46:35):~/dev/tests/ionic2/MyIonic2Project (master *%)$ ionic info
WARN: ionic.config.js has been deprecated, you can remove it.

Your system information:

Cordova CLI: 6.1.0 (cordova-lib@undefined)
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.7.0
Xcode version: Xcode 7.3 Build version 7D175

 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`


any idea ?


It’s A known angular bug. There’s a temporary fix in github.

I solve this problem by adding declare var Promise: PromiseConstructor; on the top of promise.d.ts

1 Like

There’s no need for that kludge any more. It was fixed in angular2 beta 7, so all OP has to do is edit package.json to get something newer than that. Current as I write this is beta 12.


I had the same issue this morning and updating to agular2@latest (now at beta.13) will solve the problem. But I found that I also needed to update rxjs from beta.0 to beta.2 . the npm warnings will guide you:

npm WARN angular2@2.0.0-beta.13 requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN angular2@2.0.0-beta.13 requires a peer of rxjs@5.0.0-beta.2 but none was installed.
npm WARN angular2@2.0.0-beta.13 requires a peer of zone.js@^0.6.6 but none was installed.

… using these warnings do:
npm install --save angular2@latest es6-shim@^0.35.0 rxjs@5.0.0-beta.2 zone.js@^0.6.6

note: after running this npm install be sure to edit package.json and remove the caret from rxjs@5.0.0-beta.2 to prevent other problems after npm update

1 Like