03 Nov

Ionic | Advanced Know-How

Handling build errors

How to fix TypeError: Cannot read property ‚Private‘ of undefined

$

How to fix TypeError: AppScripts.serve is not a function

$ npm install --save-dev @ionic/app-scripts@latest

How to fix Error: Cannot find module ‚@ionic/app-scripts‘

$ npm install --save-dev @ionic/app-scripts@latest

How to fix Error: Cannot find module ‚@angular/tsc-wrapped/src/tsc‘

$ npm install --save-dev @angular/tsc-wrapped@latest

How to fix Error: Cannot find module ‚@angular/compiler-cli‘

$ npm install --save-dev @angular/compiler-cli@latest

How to fix Error: Cannot read property ‚replace‘ of undefined

Read here for details

$ npm install ios-sim@latest

Or edit line 283 in file lib.js and follow https://github.com/phonegap/ios-sim/pull/213/files

vi platforms/ios/cordova/node_modules/ios-sim/src/lib.js

Change to

list.push(util.format('%s, %s', name_id_map[ filterDeviceName(devicename) ].replace(/^com.apple.CoreSimulator.SimDeviceType./, ''), runtime.replace(/^iOS /, '')));

How to fix Error: spawn EACCES

$ ionic hooks add

Working on Android

Start emulator

$ emulator -list-avds
6
6_x86_64
7
$ emulator @6

Show logfile messages

$ adb logcat

Run on Device

$ adb uninstall io.ionic.conference
$ ionic run android

Working on iOS

List available devices

$ ios-sim showdevicetypes

Run on Emulator

$ ionic emulate ios --target="iPhone-6, 10.1"

Run on Device