I have a nodejs project that the IDE labels as being in an error state (red squiggle on root) because it found an error inside node_modules. Specifically, inside the monk module's own node_modules directory, the mongoskin module has a file index.js that reads
module.exports = process.env.MONGOSKIN_COV ? require('./lib-cov/') : require('./lib/');
The error is that it can't resolve ./lib-cov. Of course, it doesn't need to, because the environment variable isn't set.
Anyway, it would be nice if WebStorm didn't complain about errors in code outside of my control, especially code that isn't actually in error. Is there some setting I'm missing? I tried marking node_modules as excluded, but that didn't help (and I don't know what other bad side effects that setting might have).
I think this error didn't actually show up until one day when I decided to browse inside node_modules to try to understand some module code. Until then, perhaps WebStorm had been smart enough not to do code analysis inside there.