5

I installed necessray packages

npm i react-bootstrap-validation", "npm install react-bootstrap

and updated typings

npm update typings

but still getting this error;

enter image description here

How can I tell tyscript I already have that module?

1 Answer 1

7

By running npm update typings you updated a tool, which is used to install typescript definitions. But you didn't install actual type definitions for react.

Actually you don't even need typings, because MS provided their own types publisher. Use this page to search for any type definitions. What you need to do is to run npm install --save @types/react-bootstrap. This effectively installs typescript definitions for react-bootrstrap.

I really recommend you to take some basic course online around react+typescript (udemy or pluralsight), because these concepts might be very very complicated when start learning from ground without much experience in the field.

10
  • Hello Sergei, thanks for answer I installed it as you said, but this time it couldnt find the Object in module. please check the post Commented Jan 30, 2017 at 20:22
  • 1
    Take a look here - they removed ButtonInput in July 2016, last commit in react-bootstrap-validation is April 2016. That's the answer - react-bootstrap-validation repository didn't updated to match latest version of react-bootstrap. Commented Jan 30, 2017 at 20:54
  • 1
    In case if no definitions, you just use var myvar: any = require("mypackage"). In that case on type checking Commented Jan 30, 2017 at 20:55
  • 1
    Take a look here - they removed ButtonInput in July 2016..... - and I know, that's absolutely madness.... but that's the real state of opensource development for javascript nowadays... unfortunately. Commented Jan 30, 2017 at 20:58
  • 1
    this is why stackoverflow is life saver.. of course its nothing but a pretty website if experienced, helpful developers like you are not here. Thank you again Commented Jan 30, 2017 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.