Step 3 / 5 Injecting the tsd.json file with installation data

Flowers

Flowers{: .callout}

For the reinstall to work there needs to be references to what is installed, so you need to manipulate the tsd.json file with the given code. Open tsd.json and in the section for the key installed, you should add this:

"jquery/jquery.d.ts": {
    "commit": "2259de6588fb6627c3e511bcf40a0e85cadefbc5"
}```

My tsd.json file now looks like this:

```json
{
  "version": "v4",
  "repo": "borisyankov/DefinitelyTyped",
  "ref": "master",
  "path": "typings",
  "bundle": "typings/tsd.d.ts",
  "installed": {
    "jquery/jquery.d.ts": {
      "commit": "2259de6588fb6627c3e511bcf40a0e85cadefbc5"
    }
  }
}

Step 4 / 5 Reinstalling the “installed” packages

From the command line you now run the following command, this will reinstall any already installed package. In this case the needed jQuery pack.

tsd reinstall --save --overwrite

My shell / command line now states:

$ tsd reinstall --save --overwrite

-> running reinstall
path not in index, attempt-adding: jquery/jquery.d.ts

>> written 1 file:

    - jquery/jquery.d.ts

Sucess, the definitions file is downloaded and ready for Visual Studio code

Got Something To Say?

Your email address will not be published. Required fields are marked *