nuxt / create-nuxt-app

Create Nuxt.js App in seconds.
MIT License
3.47k stars 428 forks source link

Cannot find module 'eslint-webpack-plugin' #1027

Open hammygoonan opened 3 years ago

hammygoonan commented 3 years ago

Versions

Reproduction

Create new app:

$ npx create-nuxt-app nuxt

create-nuxt-app v3.6.0 ✨ Generating Nuxt.js project in nuxt ? Project name: test ? Programming language: JavaScript ? Package manager: Npm ? UI framework: None ? Nuxt.js modules: Axios - Promise based HTTP client ? Linting tools: ESLint, Prettier ? Testing framework: None ? Rendering mode: Universal (SSR / SSG) ? Deployment target: Server (Node.js hosting) ? Development tools: jsconfig.json (Recommended for VS Code if you're not using typescript) ? Continuous integration: None ? Version control system: Git

$ cd nuxt
$ npm i bulma node-sass sass-loader
$ npm run dev

What is Expected?

The webpack dev server runs without issue

What is actually happening?

ERROR Cannot find module 'eslint-webpack-plugin' Require stack:

ghost commented 3 years ago

Not sure what you're package.json looks like but I would add these to your dev dependencies

"node-sass": "^4.13.0",
"sass-loader": "^8.0.0",
sussweb commented 3 years ago

I have exactly the same issue as @hammygoonan My dev dependencies are as follows:

devDependencies": {
    "@babel/core": "^7.13.8",
    "@babel/eslint-parser": "^7.13.8",
    "@babel/preset-env": "^7.13.9",
    "@graphql-codegen/cli": "^1.21.2",
    "@graphql-codegen/fragment-matcher": "^2.0.0",
    "@nuxtjs/eslint-config": "^6.0.0",
    "@nuxtjs/eslint-module": "^3.0.1",
    "@nuxtjs/google-analytics": "^2.4.0",
    "@nuxtjs/tailwindcss": "4.0.0",
    "@tailwindcss/postcss7-compat": "npm:@tailwindcss/postcss7-compat@^2.0.2",
    "@vue/test-utils": "^1.1.3",
    "autoprefixer": "^10.2.6",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "10.1.0",
    "babel-jest": "^26.0.1",
    "eslint": "^7.29.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-vue": "^7.7.0",
    "jest": "^26.0.1",
    "node-sass": "^5.0.0",
    "postcss": "^8.3.5",
    "sass-loader": "^10.1.0",
    "tailwindcss": "^2.2.4",
    "vue-eslint-parser": "^7.2.0",
    "vue-jest": "^3.0.4"
  }
hammygoonan commented 3 years ago

They're definitely both in there @EthanDunfordAspect

You can see the line in my setup above: $ npm i bulma node-sass sass-loader

{
  "name": "test",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
    "lint": "npm run lint:js"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.13.1",
    "bulma": "^0.9.3",
    "core-js": "^3.9.1",
    "node-sass": "^6.0.1",
    "nuxt": "^2.15.3",
    "sass-loader": "^12.1.0"
  },
  "devDependencies": {
    "@nuxtjs/eslint-config": "^6.0.0",
    "@nuxtjs/eslint-module": "^3.0.2",
    "babel-eslint": "^10.1.0",
    "eslint": "^7.22.0",
    "eslint-config-prettier": "^8.1.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-vue": "^7.7.0",
    "prettier": "^2.2.1"
  }
}
ghost commented 3 years ago

you need to put node-sass and sass-loader in your dev dependencies

hammygoonan commented 3 years ago

@EthanDunfordAspect I don't see why that would make any difference if they're in the dev dependencies or the dependencies.

Whatever the case i tried saving them as dev dependencies and got the same result. Here's my new package.json file:

{
  "name": "test",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
    "lint": "npm run lint:js",
    "test": "jest"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "core-js": "^3.15.1",
    "nuxt": "^2.15.7"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.14.7",
    "@nuxtjs/eslint-config": "^6.0.1",
    "@nuxtjs/eslint-module": "^3.0.2",
    "@vue/test-utils": "^1.2.1",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "^27.0.5",
    "bulma": "^0.9.3",
    "eslint": "^7.29.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-vue": "^7.12.1",
    "jest": "^27.0.5",
    "node-sass": "^6.0.1",
    "prettier": "^2.3.2",
    "sass-loader": "^12.1.0",
    "vue-jest": "^3.0.4"
  }
}

I get the exact same error.

japc78 commented 2 years ago

I have the same problem after adding the sass and sass-loader development dependencies.

Versions:

  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "core-js": "^3.15.1",
    "dotenv": "^9.0.2",
    "express": "^4.17.1",
    "nuxt": "^2.15.7",
    "ssh2-promise": "^1.0.0"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.14.7",
    "@nuxtjs/eslint-config": "^6.0.1",
    "@nuxtjs/eslint-module": "^3.0.2",
    "eslint": "^7.29.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-vue": "^7.12.1",
    "prettier": "^2.3.2",
    "node-sass": "^6.0.1",
    "sass-loader": "^10.1.1"
  }
stale[bot] commented 2 years ago

Thanks for your contribution to Nuxt! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.