Тот же вопрос, что и на forum.ionicframework.com
Прежде всего, я не использую набор текста в моем проекте. По крайней мере, не то, что я знаю. Я также не использую localforage, но это зависимость @ ionic / storage. Я установил наборы и localforage в надежде решить эту проблему, но она не решилась, и от них может остаться остаток.
Это ошибка, которую я продолжаю получать
>ionic serve
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] [10:38:53] ionic-app-scripts 3.1.10
[app-scripts] [10:38:53] watch started ...
[app-scripts] [10:38:53] build dev started ...
[app-scripts] [10:38:55] clean started ...
[app-scripts] [10:38:55] clean finished in 10 ms
[app-scripts] [10:38:55] copy started ...
[app-scripts] [10:38:58] deeplinks started ...
[app-scripts] [10:38:58] deeplinks finished in 283 ms
[app-scripts] [10:38:58] transpile started ...
[app-scripts] [10:39:04] typescript error
[app-scripts] Cannot find type definition file for 'localforage'.
[INFO] Development server running!
Local: http://localhost:8100
External: http://145.74.203.18:8100, http://192.168.137.1:8100
DevApp: Ionic_HerstelApp@8100 on DESKTOP-7D0ETN5
Use Ctrl+C to quit this process
[INFO] Browser window opened to http://localhost:8100!
Вот вывод ionic info
Ionic:
ionic (Ionic CLI) : 4.1.2 (C:\Users\*****\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.10
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 5 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\*****\AppData\Local\Android\Sdk)
NodeJS : v6.11.4 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Что, возможно, интересно, что всякий раз, когда я пытаюсь ionic cordova build android
, я получаю эту проблему
>ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[10:55:25] ionic-app-scripts 3.1.10
[10:55:26] build dev started ...
[10:55:27] clean started ...
[10:55:27] clean finished in 13 ms
[10:55:27] copy started ...
[10:55:30] deeplinks started ...
[10:55:30] deeplinks finished in 141 ms
[10:55:30] transpile started ...
[10:55:36] typescript error
[10:55:36] ionic-app-script task: "build"
[10:55:36] TypeError: Cannot read property 'replace' of null
TypeError: Cannot read property 'replace' of null
at Object.escapeHtml (C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\util\helpers.js:253:9)
at generateCodeBlock (C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\logger\logger-diagnostics.js:187:77)
at generateDiagnosticHtml (C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\logger\logger-diagnostics.js:179:12)
at Array.map (native)
at Object.printDiagnostics (C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\logger\logger-diagnostics.js:15:39)
at C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\transpile.js:158:34
at transpileWorker (C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\transpile.js:107:12)
at Object.transpile (C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\transpile.js:64:12)
at C:\symlinks\Ionic_HerstelApp\node_modules\@ionic\app-scripts\dist\build.js:109:82
Cannot find type definition file for 'localforage'.
[INFO] Looks like @ionic/app-scripts isn't installed in this project.
This package is required for this command to work properly.
? Install @ionic/app-scripts? (Y/n)
Очевидно, у меня уже установлены app-скрипты.
Еще одна вещь, на которую стоит обратить внимание, это то, что когда я запускаю ionic cordova prepare --no-build
, сценарий останавливается на Preparing Firebase on Android
, не уверенный, предназначен ли он или, возможно, firebase каким-то образом останавливает сценарий подготовки.
package.json
{
"name": "ionic_herstel_app",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/animations": "^5.2.11",
"@angular/common": "^5.2.11",
"@angular/compiler": "^5.2.11",
"@angular/compiler-cli": "^5.2.11",
"@angular/core": "^5.2.11",
"@angular/forms": "^5.2.11",
"@angular/http": "^5.2.11",
"@angular/platform-browser": "^5.2.11",
"@angular/platform-browser-dynamic": "^5.2.11",
"@ionic-native/core": "^4.12.0",
"@ionic-native/firebase": "^4.12.0",
"@ionic-native/native-audio": "^4.12.0",
"@ionic-native/splash-screen": "^4.12.0",
"@ionic-native/status-bar": "^4.12.0",
"@ionic/storage": "^2.1.3",
"angularfire2": "5.0.0-rc.4",
"cordova-android": "7.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-firebase": "^1.1.3",
"cordova-plugin-ionic-keyboard": "^2.1.2",
"cordova-plugin-ionic-webview": "^1.2.1",
"cordova-plugin-nativeaudio": "^3.0.9",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3",
"firebase": "^4.5.0",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"ng-circle-progress": "1.0.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.10",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-firebase": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-nativeaudio": {}
},
"platforms": [
"android"
]
}
}
Я сделал новый пустой проект, используя ionic start
, запустил npm install
, а затем ionic serve
. Получил ту же проблему.
Я не использую localforage в своем проекте, и я действительно не знаю, как это сделать. Google тоже не дал ответов.