Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript compiler can't found declaration #40

Closed
ikokostya opened this issue Oct 29, 2017 · 0 comments
Closed

TypeScript compiler can't found declaration #40

ikokostya opened this issue Oct 29, 2017 · 0 comments
Labels

Comments

@ikokostya
Copy link
Contributor

ikokostya commented Oct 29, 2017

  • node version - v8.6.0
  • celebrate version - 5.0.1
  • joi version (via npm ls --depth=0 | grep joi) -

Explain the problem here

Now TypeScript declaration https://github.com/continuationlabs/celebrate/blob/master/lib/index.d.ts is presented in npm package, but can't be found by TypeScript compiler:

$ ls node_modules/celebrate/lib/index.d.ts 
node_modules/celebrate/lib/index.d.ts
$ ./node_modules/.bin/tsc 

t.ts(1,28): error TS7016: Could not find a declaration file for module 'celebrate'. '/home/kostya/tmp/ts-test/node_modules/celebrate/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/celebrate` if it exists or add a new declaration (.d.ts) file containing `declare module 'celebrate';`

1 import * as celebrate from 'celebrate';
                             ~~~~~~~~~~~

For fix this need to add property types to package.json of Celebrate package:

{
+ "types": "./lib/index.d.ts"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants