Node type definitions
Node isn’t managed by npm
. As such, there’s no guarantee that running npm install -D @types/node
will install the correct type definitions for your version of Node.
Always specify the major version number when installing the Node type definitions. For example, if your version of Node is 12.16.3
, install the types as follows:
npm install -D @types/node@12
Sign up for my newsletter
A monthly round-up of blog posts, projects, and internet oddments.