TypeScript error: Ionic CLI 1.2.1, ionic-angular 2.0.0-beta.6

I am getting below error while executing “gulp build”. When i am doing “ionic serve” no app.bundle.js is formed. Can anyone please help me.

TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Observable.d.ts(29,34): Error TS1005: ‘)’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Observable.d.ts(29,46): Error TS1005: ‘=’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Observable.d.ts(29,49): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Observable.d.ts(29,78): Error TS1144: ‘{’ or ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Observable.d.ts(29,94): Error TS1005: ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,28): Error TS1005: ‘)’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,36): Error TS1005: ‘=’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,39): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,52): Error TS1005: ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,55): Error TS1131: Property or signature expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,59): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,67): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,83): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,86): Error TS1005: ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(5,87): Error TS1128: Declaration or statement expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(6,1): Error TS1128: Declaration or statement expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,28): Error TS1005: ‘)’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,36): Error TS1005: ‘=’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,39): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,52): Error TS1144: ‘{’ or ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,55): Error TS1068: Unexpected token. A constructor, meth
od, accessor, or property was expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,59): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,67): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,83): Error TS1109: Expression expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,86): Error TS1005: ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(53,87): Error TS1128: Declaration or statement expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Scheduler.d.ts(54,1): Error TS1128: Declaration or statement expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Subscription.d.ts(7,5): Error TS1131: Property or signature expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Subscription.d.ts(7,14): Error TS1005: ‘;’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/Subscription.d.ts(8,1): Error TS1128: Declaration or statement expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/scheduler/Action.d.ts(18,50): Error TS1005: ‘)’ expected.
TypeScript error: C:/xampp/htdocs/GreenView_repo/mobile-android/node_modules/ionic-native/node_modules/rxjs/scheduler/Action.d.ts(18,58): Error TS1005: ‘=’ expected.

What is your ionic info output?

Ionic CLI v1.2.1
Cordova 7.0.1
node v6.10.3
npm 3.10.10
Let me know if something else is required. Ionic info is not supported in this version of ionic.

Then install a newer version. Current Ionic CLI versions are fully compatible with Ionic v1.
npm install -g ionic to update.

Now i am getting below error on executing ionic serve:

Error: Cannot find module ‘@angular/compiler’

ionic info

global packages:

@ionic/cli-utils : 1.4.0
Gulp CLI         : CLI version 3.9.1 Local version 3.9.1
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-gulp          : 1.0.1
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework                 : ionic-angular 2.0.0-beta.6

System:

Node       : v6.10.3
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.4

Whew, that won’t be fun to update. Is this a big app? If not, think about just creating a new one and invest the time to copy the functionality over to this new project.

Post your current package.json please.

Its same as above. moving everything on a new version will be time consuming. Is that the only way of doing this? And also this error was not coming when i was using Ionic cli 1.2.1

What is same as above? You never posted your package.json before.

No, of course not. But as you were using beta software, things in there were still pretty broken and things changed until the final release. That’s why not everything will be as easy as e.g. an upgrade from 3.4 to 3.5.

package.json:

{
  "dependencies": {
    "@angular/compiler-cli": "^4.2.5",
    "@angular/tsc-wrapped": "^4.2.5",
    "@ionic/app-scripts": "^1.3.12",
    "angular2": "2.0.0-beta.15",
    "autoprefixer": "^7.1.1",
    "es6-shim": "^0.35.0",
    "ionic": "^1.2.1",
    "ionic-angular": "2.0.0-beta.6",
    "ionic-native": "^1.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.2"
  },
  "devDependencies": {
    "@ionic/cli-plugin-cordova": "1.4.0",
    "@ionic/cli-plugin-gulp": "1.0.1",
    "@ionic/cli-plugin-ionic-angular": "1.3.1",
    "del": "2.2.0",
    "gulp": "3.9.1",
    "gulp-watch": "4.3.5",
    "ionic-gulp-browserify-typescript": "^1.1.0",
    "ionic-gulp-fonts-copy": "^1.0.0",
    "ionic-gulp-html-copy": "^1.0.0",
    "ionic-gulp-sass-build": "^1.0.0",
    "ionic-gulp-scripts-copy": "^1.0.1",
    "run-sequence": "1.1.5"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard",
    "cordova-plugin-datepicker",
    "cordova-plugin-geolocation",
    "cordova-plugin-spinner-dialog"
  ],
  "cordovaPlatforms": [
    "ios",
    "android"
  ],
  "name": "ionic-staffind",
  "description": "ionic-staffind: An Ionic project"
}

To be honest I have no idea how to handle [quote=“jhingan, post:9, topic:96918”]
“ionic-angular”: “2.0.0-beta.6”,
[/quote]

This is not even part of the changelog any more: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md so if from earlier than 2016-05-19. See beta7, beta8, … beta11, rc0, … rc6 all with breaking changes until we get to a official, stable version.

(Research)

Yeah, it’s from 2016-04-21: https://github.com/ionic-team/ionic/releases/tag/v2.0.0-beta.6

(Research)

Back then it seems the most “current” CLI was https://github.com/ionic-team/ionic-cli/releases/tag/v1.7.14
1.2.1 that you were using is not even in the list of tags/releases on Github, so is from before Dec 9, 2014: https://github.com/ionic-team/ionic-cli/releases?after=1.3.19

You can try installing CLI 1.7.14 and see if your project runs with that (do a clean checkout of the project, the new CLI might have changed stuff that the old CLI doesn’t like). But you still have no real way out of there then…

(I can’t even install 1.7.14 on a current system)

Even i am not able to install 1.7.14. It is giving some exceptions. Thanks for your help though.

If you go back to the node and npm version that was current back then it should work.

Can you tell me how to resolve below error:

Error: Cannot find module '@angular/tsc-wrapped/src/tsc'

I tried below commands but did not get any success to resolve it:

npm install npm@latest -g
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest




No because with the betas everything was different - Ionic, Angular and everything.[quote=“jhingan, post:13, topic:96918”]
I tried below commands but did not get any success to resolve it:

npm install npm@latest -g
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
[/quote]

This has nothing to do with the error at all. That’s just general npm and angular-cli - which didn’t even exist back then.

Steps to fix-
Use an implicit return:

export function requireEnvs(name: string): Record<string, string> {
const names = name.map(name => ({[name]: requireEnv(name)}));
}

Regards,
Rachel Gomez