Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vuejs/eslint-plugin-vue Module build failed (from ./node_modules/eslint-loader/dist/cjs.js): Error: Cannot find module 'eslint' #150

Closed
mhabbasi-gh opened this issue Apr 6, 2021 · 2 comments

Comments

@mhabbasi-gh
Copy link

I'm having issue running my nuxt app. When I do npm run dev I get this error: Module build failed (from ./node_modules/eslint-loader/dist/cjs.js): Error: Cannot find module 'eslint'. I have tried clearing my cache, npm install and running again but didn't solve my issue. This is my package.json:

{
  "name": "client",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "test": "jest"
  },
  "dependencies": {
    "@kevinfaguiar/vue-twemoji-picker": "^5.7.4",
    "@nuxtjs/auth": "^4.9.1",
    "@nuxtjs/axios": "^5.13.1",
    "@nuxtjs/dotenv": "^1.4.1",
    "aws-amplify": "^3.3.26",
    "axios": "^0.21.1",
    "bootstrap": "^4.6.0",
    "bootstrap-vue": "^2.21.2",
    "core-js": "^3.8.3",
    "hooper": "^0.3.4",
    "moment": "^2.29.1",
    "nuxt": "^2.15.3",
    "pubnub": "^4.30.1",
    "vue-cookie": "^1.1.4"
  },
  "devDependencies": {
    "@nuxtjs/google-fonts": "^1.2.0",
    "@nuxtjs/proxy": "^2.1.0",
    "@vue/test-utils": "^1.1.2",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "^26.6.3",
    "eslint-loader": "^4.0.2",
    "fibers": "^5.0.0",
    "jest": "^26.6.3",
    "sass": "^1.32.8",
    "sass-loader": "^10.1.1",
    "vue-jest": "^3.0.4",
    "webpack": "^4.46.0"
  }
}

Also on the terminal I get this error:

Module build failed (from ./node_modules/eslint-loader/dist/cjs.js):                                  friendly-errors 21:42:49
Error: Cannot find module 'eslint'
Require stack:
- /Users/user/Desktop/Work/frontend copy/node_modules/eslint-loader/dist/getOptions.js
- /Users/user/Desktop/Work/frontend copy/node_modules/eslint-loader/dist/index.js
- /Users/user/Desktop/Work/frontend copy/node_modules/eslint-loader/dist/cjs.js
- /Users/user/Desktop/Work/frontend copy/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js
- /Users/user/Desktop/Work/frontend copy/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js
- /Users/user/Desktop/Work/frontend copy/node_modules/webpack/lib/NormalModule.js
- /Users/user/Desktop/Work/frontend copy/node_modules/webpack/lib/NormalModuleFactory.js
- /Users/user/Desktop/Work/frontend copy/node_modules/webpack/lib/Compiler.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at n (/Users/user/Desktop/Work/frontend copy/node_modules/jiti/dist/v8cache.js:2:2349)
    at getOptions (/Users/user/Desktop/Work/frontend copy/node_modules/eslint-loader/dist/getOptions.js:28:7)
    at Object.loader (/Users/user/Desktop/Work/frontend copy/node_modules/eslint-loader/dist/index.js:17:43)

Anyone knows how to fix it?

@apgapg
Copy link

apgapg commented Feb 3, 2022

You havent installed eslint package

Just perform npm i -D eslint

@antfu
Copy link
Member

antfu commented Mar 19, 2024

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

@antfu antfu closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants