Hello,
I got a problem to serve Ionic 2
I clone the repo of my client then :
$ npm i
$ ionic serve
and I got this error :
Running 'serve:before' npm script before serve
> myapp@ watch /Users/dev/DEV/MOBILE/myapp
> ionic-app-scripts watch --copy copy.config.js
[21:23:32] ionic-app-scripts 1.1.4
[21:23:32] watch started ...
[21:23:32] build dev started ...
[21:23:32] clean started ...
[21:23:32] clean finished in 1 ms
[21:23:32] copy started ...
[21:23:32] transpile started ...
[21:23:37] typescript: node_modules/@types/localforage/index.d.ts, line: 7
Subsequent variable declarations must have the same type. Variable 'driver' must be of type 'string |
[21:23:37] typescript: node_modules/@types/localforage/index.d.ts, line: 15
[21:23:37] typescript: node_modules/@types/localforage/index.d.ts, line: 25
[21:23:37] typescript: node_modules/@types/localforage/index.d.ts, line: 25
[21:23:37] typescript: node_modules/@types/localforage/index.d.ts, line: 100
[21:23:37] typescript: node_modules/localforage/typings/localforage.d.ts, line: 47
[21:23:37] typescript: node_modules/localforage/typings/localforage.d.ts, line: 52
[21:23:37] typescript: node_modules/localforage/typings/localforage.d.ts, line: 113
[21:23:37] transpile failed
string[]', but here has type 'string | LocalForageDriver | LocalForageDriver[]'.
L6: size?: number;
L8: storeName?: string;
Subsequent variable declarations must have the same type. Variable 'version' must be of type 'number', but
here has type 'string'.
L15: interface LocalForageDriver {
L16: _driver: string;
Subsequent variable declarations must have the same type. Variable '_support' must be of type 'boolean |
LocalForageDriverSupportFunc', but here has type 'boolean | Promise<boolean>'.
L24: getItem(key: string, callback: (err: any, value: any) => void): void;
L26: key(keyIndex: number, callback: (err: any, key: string) => void): void;
All declarations of '_support' must have identical modifiers.
L24: getItem(key: string, callback: (err: any, value: any) => void): void;
L26: key(keyIndex: number, callback: (err: any, key: string) => void): void;
Duplicate identifier 'export='.
Interface 'LocalForageDriver' incorrectly extends interface 'LocalForageDbMethods'. Types of property
'getItem' are incompatible. Type '(key: string, callback: (err: any, value: any) => void) => void' is not
assignable to type '{ <T>(key: string): Promise<T>; <T>(key: string, callback: (err: any, value: T) =>
void): void; }'.
L46: interface LocalForageDriver extends LocalForageDbMethods {
L47: _driver: string;
All declarations of '_support' must have identical modifiers.
L51: _support?: boolean | LocalForageDriverSupportFunc;
Duplicate identifier 'export='.
L112: export = localforage;
[21:23:37] watch ready in 4.71 s
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server: http://localhost:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
ionic $ [21:23:37] copy finished in 4.75 s
My ionic info :
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.2.1 Build version 8C1002
The package.json :
{
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@angular/router": "3.2.1",
"@ionic/cloud-angular": "^0.8.0",
"@ionic/storage": "1.1.7",
"font-awesome": "^4.7.0",
"he": "^1.1.1",
"ionic-angular": "2.0.0-rc.4",
"ionic-gulp-browserify-typescript": "^2.0.0",
"ionic-native": "^2.2.11",
"ionicons": "^3.0.0",
"localforage": "^1.4.2",
"moment": "^2.15.1",
"moment-timezone": "^0.5.6",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26",
"@ionic/app-scripts": "=1.0.0"
},
"devDependencies": {
"typescript": "2.0.9"
},
"name": "myapp",
"description": "MyApp: An Ionic project",
"author": "Myapp",
"scripts": {
"build": "ionic-app-scripts build --prod --copy copy.config.js",
"watch": "ionic-app-scripts watch --copy copy.config.js",
"serve:before": "watch",
"emulate:before": "build",
"deploy:before": "build",
"build:before": "build",
"run:before": "build"
},
"cordovaPlugins": [
"cordova-plugin-badge@~0.7.3",
"cordova-plugin-screen-orientation@~1.4.2",
"ionic-plugin-deeplinks@~1.0.12",
"cordova-plugin-compat@~1.1.0",
"onesignal-cordova-plugin@~2.0.8",
"cordova-plugin-calendar@~4.5.5",
"cordova-plugin-x-socialsharing@~5.1.3",
"cordova-plugin-wkwebview-engine@~1.1.0",
"ionic-plugin-keyboard@~2.2.1",
"ionic-plugin-deploy@~0.6.5",
"cordova-plugin-whitelist@~1.3.0",
"cordova-plugin-statusbar@~2.2.0",
"cordova-plugin-crosswalk-webview@~2.2.0",
"cordova-plugin-device@~1.1.3",
"cordova-plugin-network-information@~1.3.0",
"cordova-plugin-splashscreen@~4.0.0",
"cordova-plugin-geolocation@~2.4.0",
"cordova-plugin-inappbrowser@~1.5.0",
"cordova-plugin-camera@~2.3.0",
"cordova-plugin-app-version@~0.1.9",
"cordova-plugin-google-analytics@~1.7.1",
"onesignal-cordova-plugin",
"cordova-plugin-badge",
"cordova-plugin-screen-orientation",
"cordova-plugin-app-event",
"ionic-plugin-deeplinks",
"cordova-plugin-compat",
"cordova-plugin-calendar",
"cordova-plugin-x-socialsharing",
"cordova-plugin-wkwebview-engine",
"ionic-plugin-keyboard",
"ionic-plugin-deploy",
"cordova-plugin-whitelist",
"cordova-plugin-statusbar",
"cordova-plugin-crosswalk-webview",
"cordova-plugin-device",
"cordova-plugin-network-information",
"cordova-plugin-splashscreen",
"cordova-plugin-geolocation",
"cordova-plugin-inappbrowser",
"cordova-plugin-app-version",
"cordova-plugin-google-analytics@1.0.0"
]
}
Someone can help me please ? Thank you !