Module not found: Error: Can't resolve 'module' in '\node_modules\eslint\lib\util'
See original GitHub issueHi, I tried importing ESlint into my vue file, in which I try to build a code editor using Monaco Editor, where I want to integrate ESlint.
I was thinking of importing ESlint to my file and then, with a worker, verify the code a user writes on the editor. I simply tried the following:
import ESLint from '../../node_modules/eslint'
and I keep getting the errors:
./node_modules/eslint/lib/rules.js Module not found: Error: Can't resolve '../conf/replacements' in 'C:\............\node_modules\eslint\lib'
./node_modules/eslint/lib/util/module-resolver.js Module not found: Error: Can't resolve 'module' in 'C:\................\node_modules\eslint\lib\util'
./node_modules/eslint/node_modules/resolve-from/index.js Module not found: Error: Can't resolve 'module' in 'C:\...................\node_modules\eslint\node_modules\resolve-from'
I fixed the 1st one by going into the rules.js and changing const ruleReplacements = require("./conf/replacements").rules;
to const ruleReplacements = require("../conf/replacements.json").rules;
.
But I cannot do anything for the other 2 since the problem is at :
const Module = require("module");
and I cannot find anything named “module” in my eslint folder.
Any suggestions are welcome
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
You have to define the parser manually because dynamic loading is not supported in
eslint4b
.Linter
class has defineParser method.https://mysticatea.github.io/vue-eslint-editor/ is an example that uses ESLint and Monaco editor together, so I introduced it for a reference.
https://github.com/eslint/eslint.github.io/tree/master/js/app/demo
It looks like this question has been answered, so closing. If you need help in the future, please send a message to our mailing list or chatroom. Thanks!