Relationship between the version of node.js and the version of @types/node

node.jsTypescriptDefinitelytyped

node.js Problem Overview


I'm just started using node and wanted to try it with typescript. I did an npm install @types/node and the latest version was 7.0.4:

$ npm install @types/node
test-simple-node-typescript@0.1.0 /home/wink/prgs/test-simple-node-typescript
└── @types/node@7.0.4 

Where as the latest version of node is 7.5.0:

$ node --version
v7.5.0

What is the relationship between the version of node.js and that of @types/node?

node.js Solutions


Solution 1 - node.js

Simply, the major version and minor version tagged in the semver string of @types/node is exactly corresponding to the node's version.

If you check the index.d.ts file of @types/node in DefinitelyTyped repository, you'll see what type of node is this declaration file for through the first line comment at the top of the file:

// Type definitions for Node.js 8.10.x
// Project: http://nodejs.org/
....

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWink SavilleView Question on Stackoverflow
Solution 1 - node.js千木郷View Answer on Stackoverflow