How to install d.ts for specific version of node.js?
Asked Answered
P

1

7

Using the tsd command I ran this command tsd install node

It install the definitions file in the typings/node/node.d.ts but I can see that this definition file is for node.js version 4

Node.js v4.x API

How do I install the tsd for node version 5.11.0?

Pericarp answered 6/5, 2016 at 18:29 Comment(0)
M
5

Seems you can install specific types like this:

npm install --save @types/[email protected]

For our project we need to match the version of node supported by aws Lambda (currently 4.0.3).

Not sure how to get the list of available types, but when i put in an incorrect value, the npm feedback listed the available types:

npm ERR! notarget 
["4.0.15-alpha","4.0.16-alpha","4.0.21-alpha","4.0.22-alpha","4.0.23-alpha","4.0.24-alpha","4.0.25-alpha","4.0.26-alpha","4.0.27-alpha","4.0.28-alpha","4.0.29","4.0.30","6.0.31","6.0.32","6.0.33","6.0.34","6.0.35","6.0.36","6.0.37","6.0.38","6.0.39","6.0.40","6.0.41","6.0.42","6.0.43","6.0.44","6.0.45","6.0.46","6.0.47"]

From this I fished out the latest version of 4.x that I needed.

Mcneil answered 15/11, 2016 at 6:8 Comment(1)
You can get a list of the versions available with this command: npm view @types/node versionsSkvorak

© 2022 - 2024 — McMap. All rights reserved.