Webpack - extract-text-webpack-plugin Cannot find module

后端 未结 6 2402
面向向阳花
面向向阳花 2021-02-18 21:45

webpack.config.js

var ExtractTextPlugin = require(\"extract-text-webpack-plugin\");

I immediately receive this error if I just

相关标签:
6条回答
  • 2021-02-18 22:12

    Simple fix

    npm install extract-text-webpack-plugin --save-dev
    

    https://www.npmjs.com/package/extract-text-webpack-plugin

    0 讨论(0)
  • 2021-02-18 22:19

    Running npm i node-sass might solve your problem

    0 讨论(0)
  • 2021-02-18 22:28

    Use $ npm i -D extract-text-webpack-plugin@next and this would solve your issue

    Let me know if this worked.

    https://github.com/webpack/webpack/issues/6568

    0 讨论(0)
  • 2021-02-18 22:35

    You can try this command which I found on https://www.npmjs.com/package/extract-text-webpack-plugin

    npm i extract-text-webpack-plugin
    
    0 讨论(0)
  • 2021-02-18 22:35

    I solve it by use

    npm install extract-text-webpack-plugin --save-dev

    0 讨论(0)
  • 2021-02-18 22:37

    Do you have webpack module on your project?
    If not, install it locally (not globally):

    $ npm install webpack [--save-dev]
    

    extract-text-webpack-plugin needs webpack as peer dependency, but npm 3 doesn't install peer dependencies automatically.

    0 讨论(0)
提交回复
热议问题