2

I'm having problems with npm run dev. It keeps on telling me that module webpack-cli/bin/config-yargs cannot be found. Modules added like webpack, webpack-cli, and webpack-dev-server are on their latest versions. Anyone who also experienced same issue?

I already tried reinstalling the modules stated above and looked around github and stack forums for solution and none of them worked for me

package.json:

scripts: {
    "dev": "webpack-dev-server --inline --progress --config 
            build/webpack.dev.conf.js",
    "start": "npm run dev",
    "unit": "jest --config test/unit/jest.conf.js --coverage",
    "e2e": "node test/e2e/runner.js",
    "test": "npm run unit && npm run e2e",
    "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
    "build": "node build/build.js"
},
devDependencies: {
    "webpack": "^4.28.2",
    "webpack-bundle-analyzer": "^3.0.3",
    "webpack-cli": "^3.1.2",
    "webpack-dev-server": "^3.1.13",
    "webpack-merge": "^4.1.0",
    "mini-css-extract-plugin": "^0.5.0"
}

Modules are already installed and it should start running instead of throwing

Cannot find module 'webpack-cli/bin/config-yargs'


UPDATE 12/26/2018

webpack v4 doesn't support extract-text-webpack-plugin so I replaced it with mini-css-extract-plugin and now it shows this result

Cannot find module 'mini-css-extract-plugin'

2
  • Maybe something was wrong in your webpack.dev.conf.js? You could provide that code. Commented Dec 26, 2018 at 8:32
  • It's working now. I made another project and added mini-css-extract-plugin at devDependencies, and updated webpack.dev.cong.js :) Commented Dec 27, 2018 at 0:08

1 Answer 1

1

FINALLY

So I created a new project and added mini-css-extract-plugin in devDependencies and updated webpack.dev.conf.js with

const MiniCssExtractPlugin = require('mini-css-extract-plugin')

since extract-text-webpack-plugin is deprecated when using webpack v4 and now it works!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.