I recently upgraded my project to use the @hapi/hapi node modules vs. the old hapi module. I'm using version 18.3.1 ("@hapi/hapi": "^18.3.1").
My Typescript definitions no longer work as the Import reads: import * as Hapi from 'hapi';
When running the node process I get the module not found error. Is there a way to point the @types/hapi typings to the new @hapi/hapi module?
Uninstall the @types/hapi dependency. This didn't work for me moving to 18.3.1. Instead install @types/hapi__hapi. I searched for a while and ran across that package, which seems to do the trick.
npm un @types/hapi -D
npm i @types/hapi__hapi -D
Then instead of importing from 'hapi', import from '@hapi/hapi'.
import * as Hapi from '@hapi/hapi';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With