Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'. #997

Closed
aakashjangid opened this issue Oct 25, 2019 · 9 comments

Comments

@aakashjangid
Copy link

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.

@langkydoanh
Copy link

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",

@srivishalsangepu
Copy link

srivishalsangepu commented Oct 31, 2019

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.

@agamgupta6
Copy link

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",

@smithtaylorg
Copy link

smithtaylorg commented Nov 9, 2019

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"

@Roncy13
Copy link

Roncy13 commented Nov 12, 2019

same thing goes for me

@jeanfliu
Copy link

I tried to add "node" in tsconfig.jsontsconfig.app.json .
image

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 !

@agamgupta6
Copy link

@jeanfliu Yes, it worked for me also but the drawback is you do not have type suggestions in editor

@GustavDjavulen
Copy link

I erase the NodeJS.TypedArray from "index.d.ts" in de "node_modules/exceljs"

that works for me :)

image

not the best form to fix it but works

@Alanscut
Copy link
Member

Thanks for opening this request.
Please re-open if you still have issues.
Best of luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants