Fixing Typings error: Unable to find “react” (“npm”) in the registry

When I first tried to use typings, I got a lot of errors like this:

typings ERR! message Unable to find "react" ("npm") in the registry. Did you want to try searching another source?Also, if you want contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/react/versions/latest responded with 404, expected it to equal 200

typings ERR! cwd /Users/gary/youtube
typings ERR! system Darwin 14.0.0
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install" "react" "--save"
typings ERR! node -v v6.0.0
typings ERR! typings -v 0.8.1

typings ERR! If you need help, you may report this error at:
typings ERR!   

This means that while the type bindings you’re trying to download may not exist, they do not exist in the default source location, which apparently is npm.

To fix this, you need to re-run the search command, like so, to find the correct location:

typings search --name react
Viewing 1 of 1

NAME  SOURCE HOMEPAGE                         DESCRIPTION UPDATED                 
react dt     http://facebook.github.io/react/             2016-04-23T06:59:14.000Z

In this case the source is “dt”, so you need to run this command (note the apostrophes – needed for bash):

typings install 'dt!react' --save

Which will give you this output, showing that it works:

react
└── (No dependencies)