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 name 'require'. Do you need to install type definitions for node? Try npm i @types/node and then add - TypeScript 2.xnode to the types field in your tsconfig.” Code Answer’s #1

Closed
JeanPaulll opened this issue Mar 28, 2022 · 0 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@JeanPaulll
Copy link
Owner

TypeScript 2.x

npm install @types/node --save-dev

The Future of Declaration Files (6/15/2016)

Tools like Typings and tsd will continue to work, and we’ll be working alongside those communities to ensure a smooth transition.

Verify or Edit your src/tsconfig.app.json so that it contains the following:

...
"types": [ "node" ],
"typeRoots": [ "../node_modules/@types" ]
...

Make sure is the file in the src folder and no the one on the root app folder.

By default, any package under @types is already included in your build unless you've specified either of these options. Read more

@JeanPaulll JeanPaulll added help wanted Extra attention is needed question Further information is requested labels Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant