carvalhoviniciusluiz / cpf-cnpj-validator

Valida e formata strings de CPF ou CNPJ.
MIT License
207 stars 27 forks source link

Cannot find module 'Joi' #2

Closed lfernando-silva closed 5 years ago

lfernando-silva commented 5 years ago

Following the tutorial, received the following error

Error: Cannot find module 'joi' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (/Users/luizfernando/Documents/Projects/Proveu/sgjt/node-rest-api/node_modules/cpf-cnpj-validator/dist/cpf-cnpj-validator.cjs.js:10:11) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Once I installed the joi module, it worked fine.

May the joi dependency might to be included as dependency and not only to devDependencies.

Anyway, thanks for the great work!

carvalhoviniciusluiz commented 5 years ago

thanks

MallikaG commented 5 years ago

@carvalhoviniciusluiz I am facing the same issue. Which version of joi module did you installed to solve the issue

lfernando-silva commented 5 years ago

@carvalhoviniciusluiz I am facing the same issue. Which version of joi module did you installed to solve the issue

In my case, I just installed the last one with the default npm install joi --save command.

carvalhoviniciusluiz commented 5 years ago

lib joi is obsolete, the project has been updated to use the current @hapi/joi repository. @MallikaG you can install the old version which should solve npm i joi -S

remembering to delete node_modules folder.