Closed eran10 closed 6 years ago
Node should resolve '.json' files without the extension. Which version of Node are you using?
latest node (8.9.4), when i added myself .json it only worked (windows)
Hmm, not sure what is going on, this is from the Node documentation about how require resolves file name:
If the exact filename is not found, then Node.js will attempt to load the required filename with the added extensions: .js, .json, and finally .node.
I would suggest this might be an issue with your setup as no one else is reporting this issue. Have you got repo or anything so I might able to see what's happening?
no its private, when i change to .json it work as expected so i will fork this repo.. although i do believe that if you will put .json it will be even clearer to understand the line but as you want dear
OK, sorry I can't help much more ... I'm happy to release a patch update if you can wait.
v2.0.1 released with .json extension for you.
thanks!
ERROR in ./node_modules/mongoose-validator/lib/mongoose-validator.js Module not found: Error: Can't resolve './default-error-messages'
you must add .json to your file so it will work instead of const defaultErrorMessages = require('./default-error-messages') use this const defaultErrorMessages = require('./default-error-messages.json')