Ионная ошибка при работе в модулях узла - PullRequest
0 голосов
/ 16 мая 2018

Я получаю пару ошибок в модуле узла при попытке запустить приложение, используя ionic и cordova build.Я получаю сообщение об ошибке при запуске ionic cordova запуска androidcommand в командной строке.Я также попытался обновить ionic и angular до последней сборки, все еще показывая мне ту же ошибку.Можете ли вы помочь решить эту проблему.Ниже приведен мой файл package.json.Пожалуйста, посмотрите.

[01:39:24]  typescript: F:/Ionic apps/myApp/node_modules/@ionic/app-scripts/dist
/util/interfaces.d.ts, line: 1
            Cannot find type definition file for 'node'.

       L1:  import { CompilerHost, CompilerOptions, Program } from 'typescript';

       L2:  import { FileCache } from './file-cache';

[01:39:24]  typescript: F:/Ionic apps/myApp/node_modules/@ionic/app-scripts/dist
/util/interfaces.d.ts, line: 131
            Cannot find name 'Buffer'.

     L130:  writeFile(filePath: string, fileContent: Buffer, callback: Function)
: void;
     L131:  mkdirp(filePath: string, callback: Function): void;
     L132:  mkdir(filePath: string, callback: Function): void;

Error: Failed to transpile program
    at BuildError.Error (native)
    at new BuildError (F:\Ionic apps\myApp\node_modules\@ionic\app-scripts\dist\
util\errors.js:16:28)
    at F:\Ionic apps\myApp\node_modules\@ionic\app-scripts\dist\transpile.js:159
:20
    at transpileWorker (F:\Ionic apps\myApp\node_modules\@ionic\app-scripts\dist
\transpile.js:107:12)
    at Object.transpile (F:\Ionic apps\myApp\node_modules\@ionic\app-scripts\dis
t\transpile.js:64:12)
    at F:\Ionic apps\myApp\node_modules\@ionic\app-scripts\dist\build.js:109:82
[01:39:25]  copy finished in 14.86 s

F:\Ionic apps\myApp>

Ниже приведен мой package.json`

  "name": "cricket",
  "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.9",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/compiler-cli": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@firebase/app": "^0.1.10",
    "@ionic-native/core": "4.5.3",
    "@ionic-native/splash-screen": "4.5.3",
    "@ionic-native/status-bar": "4.5.3",
    "@ionic/pro": "1.0.20",
    "@ionic/storage": "^2.1.3",
    "angularfire2": "^5.0.0-rc.6.0",
    "cordova-android": "^6.3.0",
    "cordova-plugin-device": "^2.0.1",
    "cordova-plugin-firebase": "^0.1.25",
    "cordova-plugin-ionic-keyboard": "^2.0.5",
    "cordova-plugin-ionic-webview": "^1.2.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.3.0",
    "firebase": "^4.13.1",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "path": "^0.12.7",
    "rxjs": "5.5.7",
    "sw-toolbox": "3.6.0",
    "upstox": "^1.2.3",
    "zone.js": "0.8.20"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^3.1.7",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-firebase": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {}
    }
    
  }
}

`

1 Ответ

0 голосов
/ 16 мая 2018

Я решил эту проблему, проверив совместимость cordova-android и @ ionic / app-scripts с Описание журнала изменений
1. Установите версию cordova-android (6.4.0 или 6.3.0) и версию @ ionic / app-scripts (3.1.8)
2. Удалите платформу Android и добавьте ее.

...