Ionic error while running in node modules

I get couple of errors in node modules while trying to run app using ionic and cordova build . I am getting error while running ionic cordova run androidcommand on command line. I also tried updating ionic and angular to latest build still showing me same error. Can you please help solving this issue. Following is my package.json file. Please have a look.

[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>

Following is my 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 answer

  • answered 2018-05-16 09:00 Pradnya Sinalkar

    I solved this issue by checking cordova-android and @ionic/app-scripts compatibility from Changelog Description
    1. Install cordova-android version (6.4.0 or 6.3.0) and @ionic/app-scripts version(3.1.8)
    2. Remove android platform and add it agian.