Search code examples
node.jsintellij-idearequirejsbcryptcode-inspection

IntelliJ inspection saying module.exports does not exist for nodejs


IntelliJ is giving a warning of

Property exports is not defined in type Module

wherever I use module.exports= anywhere in the project.


Solution

  • In my case the bcrypt nodejs module has a file called "minimal-env.js" in its source which has the line var module; in it. IntelliJ was treating this as the proper definition of "module" for whatever reason. Just commenting out this line fixed the problem. If this happens to you too, try going to the declaration of "module" (ctrl+left-click on it).