typescript: node_modules/@types/node/index.d.ts, line: 194

typescript: node_modules/@types/node/index.d.ts, line: 194
Subsequent variable declarations must have the same type. Variable ‘process’ must be of type ‘{ env: { [key:
string]: string; }; }’, but here has type ‘Process’.

 L193:  interface RequireResolve {
 L194:      (id: string, options?: { paths?: string[]; }): string;
 L195:      paths(request: string): string[] | null;

“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.12.0”,
@ionic-native/splash-screen”: “~4.12.0”,
@ionic-native/status-bar”: “~4.12.0”,
@ionic/pro”: “2.0.3”,
@ionic/storage”: “2.1.3”,
“cordova-android”: “7.0.0”,
“cordova-ios”: “4.5.5”,
“cordova-plugin-device”: “^2.0.2”,
“cordova-plugin-ionic-keyboard”: “^2.1.2”,
“cordova-plugin-ionic-webview”: “^2.1.0”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-whitelist”: “^1.3.3”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“rxjs”: “5.5.11”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.26”
},
“devDependencies”: {
@ionic/app-scripts”: “3.2.0”,
@ionic/lab”: “1.0.8”,
@types/node”: “^10.9.2”,
“typescript”: “~2.6.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-whitelist”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {},
“cordova-plugin-ionic-keyboard”: {}
},
“platforms”: [
“android”,
“ios”
]
}
}

Ionic:

ionic (Ionic CLI) : 4.1.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 3 other plugins)

System:

ios-deploy : 2.0.0
ios-sim : 7.0.0
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 6.4.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000

I use Node 8 for Ionic, but I’m also building a Node CLI tool in Node 10.9.2. I have types installed in both environments, and I don’t see this error in either one. I think there is something special about your installation. Please post package.json.

“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.12.0”,
@ionic-native/splash-screen”: “~4.12.0”,
@ionic-native/status-bar”: “~4.12.0”,
@ionic/pro”: “2.0.3”,
@ionic/storage”: “2.1.3”,
“cordova-android”: “7.0.0”,
“cordova-ios”: “4.5.5”,
“cordova-plugin-device”: “^2.0.2”,
“cordova-plugin-ionic-keyboard”: “^2.1.2”,
“cordova-plugin-ionic-webview”: “^2.1.0”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-whitelist”: “^1.3.3”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“rxjs”: “5.5.11”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.26”
},
“devDependencies”: {
@ionic/app-scripts”: “3.2.0”,
@ionic/lab”: “1.0.8”,
@types/node”: “^10.9.2”,
“typescript”: “~2.6.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-whitelist”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {},
“cordova-plugin-ionic-keyboard”: {}
},
“platforms”: [
“android”,
“ios”
]
}
}

Ionic:

ionic (Ionic CLI) : 4.1.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 3 other plugins)

System:

ios-deploy : 2.0.0
ios-sim : 7.0.0
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 6.4.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000

Do you see how the version of types does not match the version of Node? I’d fix that first. The Node 8 API is not the same as the Node 10 API.

Edit: Also, it’s a tiny bit better to save all types files as dev dependencies. In other words:

npm install @types/node@version --save-dev

You don’t need the type information at runtime. All of Typescript is a compile-time trick. The dev dependencies exist at compile time but are not bundled into the pure js distribution.

This is a known issue in the @ionic/cli repo. Please see #3541

It can be solved adding "types": [] to the "compilerOptions" parameter of the file tsconfig.json.

1 Like

@Dellos7 This worked for me! I was getting this error when running ‘ionic cordova build ios’.
The error was:

An error occured while running subprocess ionic-app-scripts
and it was failing at:
typescript: node_modules/@types/cordova/index.d.ts, line:78