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
Labels
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
The text was updated successfully, but these errors were encountered: