Closed emclab closed 5 years ago
Other than to remove all deps and clean cache, I don’t have other advice. It clearly works for everyone else.
Upgraded node to 10.16.0 and the error is the same.
It's likely your code is wrong, the stack trace clearly reads you explicitly require joi in your models/user.js file. I'd look that way.
I am facing the same issue. @emclab How did you resolve it?
I have the same issue
I have the same issue
Just install this types package https://www.npmjs.com/package/@types/hapi__joi
I discovered my issue arose from having installed the most recent nodejs version (13>).
I solved it by updating npm. Run npm install -g npm
.
I had the same problem and I found out that i had another dependency that required 'joi' instead of '@hapi/joi'.
I had the same problem and I found out that i had another dependency that required 'joi' instead of '@hapi/joi'.
How to find that "another dependency"? @thirdink
npm ls joi
or yarn why joi
depending on which you use.
This took me a very long time to debug. In one faraway file I had imported @hapi/Joi
(notice the capital J
rather than @hapi/joi
(lowercase j
)
Make sure you are doing require("@hapi/joi")
with lowercase letters!
Install it globally... npm i -g @hapi/joi
Yeah no, don't ever do that.
Yeah no, don't ever do that.
Why? I resolved the same issue by doing that.
Because the same version is installed system wide, that's not how you deal with node projects.
Just
You Are Right bro @yadynesh
I have the same issue
Just install this types package https://www.npmjs.com/package/@types/hapi__joi
For me worked: npm i @types/joi
@nicolasmarino99 joi
ships its own types: https://github.com/hapijs/joi/blob/master/lib/index.d.ts (at least in recent versions). You shouldn't have to install types from DefinitelyTyped if you use latest version.
Context
What are you trying to achieve or the steps to reproduce ?
Installation of @hapi/joi failed to start. Removed Joi 13.x and installed @hapi/joi with
yarn add @hapi/joi
. Installation finished successfully. However node index.js throws error. yarn remove the module, delete the subdirjoi
and@hapi/joi
undernode-modules
and reinstall @hapi/joi, the error is the same when launching the project.