ERROR in node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'.
aakashjangid opened this issue · comments
Code is failed to compile and giving below error -
ERROR in node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'.
Details -
exceljs - ^3.3.0
@angular/cli - 7.3.9
I already tried each and every suggestion from everyone, but nothing worked for me.
Need this error to be removed so that code gets compiled successfully.
The same issue:
ERROR in node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'.
"@angular/cli": "~7.0.4",
"@types/node": "~8.9.4",
"exceljs": "^3.3.0",
Failed to compile.
node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'.
Tried with npm install after the installing specific package installation but still facing the same issue.
Same error for me
"@angular/animations": "~7.2.0",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"core-js": "^2.5.4",
"exceljs": "^3.3.0",
"file-saver": "^2.0.2",
I am getting the same error: ERROR in node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'. I tried the suggestions in #971, but none of those worked for me. Anyone find a fix yet?
"exceljs": "^3.3.1"
"core-js": "^2.6.10"
"@angular-devkit/build-angular": "^0.13.9",
"@angular/animations": "^7.2.15",
"@angular/cli": "^7.3.9",
"@angular/common": "^7.2.15",
@angular/compiler": "^7.2.15",
"@angular/compiler-cli": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/forms": "^7.2.15",
"@angular/http": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/router": "^7.2.15",
"typescript": "^3.2.4"
"webpack": "^4.41.2"
same thing goes for me
I tried to add "node"
in tsconfig.json、tsconfig.app.json .
Then got the error:
ERROR in node_modules/exceljs/index.d.ts(1661,41): error TS2694: Namespace 'NodeJS' has no exported member 'TypedArray'
-> update @types/node
And referenced this #971 (comment), edited my code like below:
const Excel = require('exceljs');
const workbook = new Excel.Workbook();
It works for me !
@jeanfliu Yes, it worked for me also but the drawback is you do not have type suggestions in editor
Thanks for opening this request.
Please re-open if you still have issues.
Best of luck.