adaltas / node-http-status

Utility to interact with HTTP status code in Node.js
Other
441 stars 55 forks source link

Failed to work with typescript: "Cannot find module 'http-status'" #18

Closed idiotWu closed 7 years ago

idiotWu commented 7 years ago

While using the module with typescript as

import * as HttpStatus from 'http-status';

It throws an error with error TS2307: Cannot find module 'http-status'.

I think this failure is caused by the main entry in package.json, problem gets resolved once I change it into main: ./lib/index.js.

Though this is likely to be a bug of typescript itself (Microsoft/TypeScript#13484), it would be appreciated if you can do a quick fix :)

wdavidw commented 7 years ago

try now with version 0.2.5, main is now ""main": "lib/index.js""

idiotWu commented 7 years ago

Thanks!