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

Cannot find namespace 'NodeJS'. #320

Closed
drochgenius opened this issue Oct 28, 2016 · 8 comments
Closed

Cannot find namespace 'NodeJS'. #320

drochgenius opened this issue Oct 28, 2016 · 8 comments

Comments

@drochgenius
Copy link

I just updated my project to Typescript 2.0 and Typedoc@latest, and I get this error thrown from Typedoc.

 Cannot find namespace 'NodeJS'.

I had to change a type from number to NodeJS.Timer, because of a change in the type definition for setTimeout in Node type definitions.

Any idea how I can fix this issue?

@aciccarello
Copy link
Collaborator

Be aware that some of the newer TypeScript 2.0 features are not supported. This could affect how TypeDoc looks up the types for your project.

@aciccarello
Copy link
Collaborator

Are you using the types option in your tsconfig.json? See #311 for the state of that option.

@Fzum
Copy link

Fzum commented May 13, 2017

@drochgenius Got the same exact problem. also with number to Timer. Did you already find a solution? thanks

@Fzum
Copy link

Fzum commented May 13, 2017

If you also have tsconfig.app.json in your working directory, try to add the attribute node to the types field. Like:
{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "module": "es6", "baseUrl": "", "types": ["node"] --> ADD THIS }, "exclude": [ "test.ts", "**/*.spec.ts" ] }

This was working for me..

@Murilo-Perrone
Copy link

For me "types": ["node"] didn't work, but it worked by adding this directive:

{
  "compilerOptions":
  {
    ...
    "typeRoots": [
      "node_modules/@types"
    ]
  }
}

PS: I'm in an ionic 3 project running on Windows.

@aciccarello
Copy link
Collaborator

@Murilo-Perrone I thought TypeScript includes all @types definitions if types and typeRoots are not set.

https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 17, 2020

This seems to be working, I can't reproduce the issue without specifically configuring TypeDoc to break this.

Please open a new issue with a reproduction if you are still having the problem.

@zedmyls
Copy link

zedmyls commented Aug 14, 2024

If you also have tsconfig.app.json in your working directory, try to add the attribute node to the types field. Like: { "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "module": "es6", "baseUrl": "", "types": ["node"] --> ADD THIS }, "exclude": [ "test.ts", "**/*.spec.ts" ] }

This was working for me..

works for me. thx

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

6 participants