I'm using a library with Typescript, and getting a compiler error.
public/components/chatlogs.ts(25,19): error TS2304: Cannot find name 'Handsontable'.
it seems there is a typings for it:
$ typings search handsontable
Viewing 2 of 2
NAME SOURCE HOMEPAGE DESCRIPTION UPDATED
handsontable dt https://handsontable.com/ 2016-04-12T15:30:16.000Z
jquery-handsontable dt http://handsontable.com 2016-03-29T17:54:46.000Z
but then i cant install that?
$ typings install handsontable
typings ERR! message Unable to find "handsontable" for "npm" in the registry. Did you want to install ambient typings with the ambient flag? If you can contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/handsontable/versions/latest responded with 404, expected it to equal 200
typings ERR! cwd /Users/dc/dev/rikai/boteditor
typings ERR! system Darwin 15.3.0
typings ERR! command "/usr/local/bin/iojs" "/usr/local/bin/typings" "install" "handsontable"
typings ERR! node -v v5.1.1
typings ERR! typings -v 0.7.12
typings ERR! If you need help, you may report this error at:
typings ERR! <https://github.com/typings/typings/issues>
➜ boteditor git:(master) ✗
Is there some way to use a different "source" than npm?
typings help install
Usage: typings <command>
Commands:
bundle, i, in, info, init, install, la, list, ll, ls, open, r, remove, rm,
search, uninstall, view
typings <command> -h Get help for <command>
typings <command> -V Enable verbose logging
typings --version Print the CLI version
typings@0.7.12 /usr/local/lib/node_modules/typings
How do I install a typings that is listed with a different homepage?
Or maybe they exist for tsd but not typings?
You can directly copy a typings file from Definitely Typed Typescript and paste it in your project.
You can also download the whole definitely typed github project from above link, copy and paste the required typings files according to your need.
As @basarat told
would be an another option to download typings file.
For more info on typings file, like how to use them, what they contain look at Definitely Typed.
Regards
Ajay
Type definitions in DefinitelyTyped are considered
ambient
. So you need to install with the ambient flag:More on ambient
When to use ambient while searching for a type definition?
try using the following command if there is a source for dt or env
typings install --global en~node
I believe
global
has replacedambient
as a keyword, andsource~packagename
is the syntax, for example:still unclear what the
env
ordt
typings repo distinctions are. surelydt
is the default place that is searched, so why is there a need to specify it?The ERR message actually suggest what you should do (adding line breaks for SO):
To get the help message on typings, you should do
In this case
You can configure the
defaultSource
anddefaultAmbientSource
in.typingsrc
.