Once upon a time...
While updating an Angular application, I encountered an error while running ng serve:
"ERROR in node_modules/@types/node/index.d.ts(117,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{ id: string; }', but here has type 'NodeModule'"
To resolve this issue, I navigated to node_modules/@types/node/index.d.ts(117,13) and made the following MANUAL change:
//declare var module: NodeModule; <---- old text
declare var module: { id: string; }; <--- new text
After making this adjustment, the code compiled successfully. Now, it's time to test the application...
Running ng -v:
Angular CLI: 6.0.8
Node: 8.11.3
OS: darwin x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
Reviewing the package.json file:
{
"name": "client",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@ng-bootstrap/ng-bootstrap": "^1.1.2",
"@ngui/map": "^0.18.6",
"bootstrap": "^3.3.7",
"core-js": "^2.5.7",
"ng2-file-upload": "^1.3.0",
"rxjs": "^5.5.12",
"rxjs-compat": "^6.3.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "^6.2.3",
"@angular/compiler-cli": "^5.0.0",
"@types/googlemaps": "^3.30.13",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.117",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "^3.0.0",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.1",
"ts-node": "~2.0.0",
"tslint": "^5.0.0",
"typescript": "^2.9.2"
}
}