question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Error: Can't resolve 'module' in '\node_modules\eslint\lib\util'

See original GitHub issue

Hi, 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:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mysticateacommented, Feb 12, 2019

Thanks for the suggestions! I have looked into eslint4b, but I was getting a message Cannot find module 'babel-eslint'. (I had babel-eslint as the set parser option in my eslintrc file).

You have to define the parser manually because dynamic loading is not supported in eslint4b. Linter class has defineParser method.

The other one though is, by my undestanding, eslint to be used on vue files. What I want is to load eslint into my vue file to use for the code editor I am creating, not to lint the vue file itself.

https://mysticatea.github.io/vue-eslint-editor/ is an example that uses ESLint and Monaco editor together, so I introduced it for a reference.

could you point me to the demo files, cause I cannot seem to find them.

https://github.com/eslint/eslint.github.io/tree/master/js/app/demo

0reactions
nzakascommented, Feb 18, 2019

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - ESLint error in version 8.8.0 - Stack Overflow
So I've been following the front-end masters "Intro to React, v7" course, and in it, there is a portion of the course dedicated...
Read more >
problem with eslint Module not found: Error: Can't resolve 'fs ...
Queries related to “problem with eslint Module not found: Error: Can't resolve 'fs' in '/opt/build/repo/code/node_modules/eslint-plugin-react/ ...
Read more >
Cannot find module '@typescript-eslint/eslint-config' - YouTrack
Error : Cannot find module '@typescript-eslint/eslint-config' Referenced from: /Users/me/RubymineProjects/myapp/.eslintrc.yaml Error: Cannot find module ...
Read more >
Requiring modules in Node.js: Everything you need to know
If Node can't find find-me.js in any of these paths, it will throw a “cannot find module error.” ~/learn-node $ node > require('find-me')...
Read more >
Npm install error(fails) - M220JS - MongoDB
npm WARN deprecated libnpmconfig@1.2.1: This module is not used anymore. npm ... npm ERR! gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found