Ionic Native Google Maps: команда Ionic-App-Scripts не найдена - PullRequest
0 голосов
/ 02 октября 2018

Я пытаюсь заняться разработкой мобильных приложений с интеграцией карт.В настоящее время я пытаюсь сделать это с помощью: Node Ionic Cordova Cordova Плагин Google Maps для Windows 10 (сборка 1803)

Само приложение создается правильно при создании пустого шаблона и нормально загружается.Однако, когда я добавляю ссылки на мой плагин Google Maps, это приводит к этой ошибке:

[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? Yes
> npm i -D -E @ionic/app-scripts
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated hoek@2.16.3: The major version is no longer supported. Please update to 4.x or newer
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ @ionic/app-scripts@3.2.0
updated 1 package and audited 9232 packages in 21.358s

found 6 vulnerabilities (5 moderate, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
> ionic-app-scripts build
[08:15:08]  ionic-app-scripts 3.2.0
[08:15:08]  build dev started ...
[08:15:08]  clean started ...
[08:15:08]  clean finished in 3 ms
[08:15:08]  copy started ...
[08:15:08]  deeplinks started ...
[08:15:08]  deeplinks finished in 14 ms
[08:15:08]  transpile started ...
[08:15:14]  typescript: ...fors/ionic2-native-maps/node_modules/ionic-native/node_modules/rxjs/Subject.d.ts, line: 16
            Class 'Subject<T>' incorrectly extends base class 'Observable<T>'. Types of property 'lift' are
            incompatible. Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator:
            Operator<T, R>) => Observable<R>'. Type 'Observable<T>' is not assignable to type 'Observable<R>'. Type 'T'
            is not assignable to type 'R'.

      L16:  export declare class Subject<T> extends Observable<T> implements ISubscription {
      L17:      observers: Observer<T>[];

[08:15:14]  typescript: ...node_modules/ionic-native/node_modules/rxjs/observable/dom/WebSocketSubject.d.ts, line: 23
[08:15:14]  ionic-app-script task: "build"
[08:15:14]  Error: Failed to transpile program
Error: Failed to transpile program
    at new BuildError (C:\Users\Brett Lidfors\ionic2-native-maps\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at C:\Users\Brett Lidfors\ionic2-native-maps\node_modules\@ionic\app-scripts\dist\transpile.js:159:20
    at new Promise (<anonymous>)
    at transpileWorker (C:\Users\Brett Lidfors\ionic2-native-maps\node_modules\@ionic\app-scripts\dist\transpile.js:107:12)
    at Object.transpile (C:\Users\Brett Lidfors\ionic2-native-maps\node_modules\@ionic\app-scripts\dist\transpile.js:64:12)
    at C:\Users\Brett Lidfors\ionic2-native-maps\node_modules\@ionic\app-scripts\dist\build.js:109:82
    at <anonymous>
            Class 'WebSocketSubject<T>' incorrectly extends base class 'AnonymousSubject<T>'. Types of property 'lift'
            are incompatible. Type '<R>(operator: Operator<T, R>) => WebSocketSubject<R>' is not assignable to type
            '<R>(operator: Operator<T, R>) => Observable<T>'. Type 'WebSocketSubject<R>' is not assignable to type
            'Observable<T>'. Types of property 'operator' are incompatible. Type 'Operator<any, R>' is not assignable to
            type 'Operator<any, T>'. Type 'R' is not assignable to type 'T'.

      L23:  export declare class WebSocketSubject<T> extends AnonymousSubject<T> {
      L24:      url: string;

[ERROR] ionic-app-scripts command not found.

Я попытался «удалить ваши модули и запустить установку npm», и даже попытался сделать это со вторым проектом.Есть ли какие-либо известные проблемы с этой комбинацией, или кто-то может предложить другое решение? Я рад предоставить дополнительную информацию.

РЕДАКТИРОВАТЬ: Вот мой файл package.json:

{
  "name": "ionic2-native-maps",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "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.15.0",
    "@ionic-native/google-maps": "^4.14.0",
    "@ionic-native/splash-screen": "^4.15.0",
    "@ionic-native/status-bar": "~4.12.0",
    "@ionic/storage": "2.2.0",
    "@types/google-maps": "^3.2.0",
    "cordova-android": "7.1.1",
    "cordova-ios": "3.9.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-googlemaps": "2.4.6",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.1.4",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "ionic-angular": "3.9.2",
    "ionic-native": "^2.9.0",
    "ionicons": "3.0.0",
    "node-sass": "^4.9.3",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.0",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-googlemaps": {
        "API_KEY_FOR_ANDROID": "MY KEY IS HERE",
        "API_KEY_FOR_IOS": "MY KEY IS HERE",
        "PLAY_SERVICES_VERSION": "15.0.1",
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      }
    },
    "platforms": [
      "android"
    ]
  }
}

1 Ответ

0 голосов
/ 02 октября 2018

Пожалуйста, используйте следующие команды:

rm -rf node_modules package-lock.json
npm install

Если это не работает, вам нужно добавить ниже в ваш файл tsconfig.json:

"noStrictGenericChecks": true

...