Luca Mormile
Luca Mormile

Reputation: 1187

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

webpack.config.js

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

I immediately receive this error if I just implement the plugin:

module.js:339
    throw err;
    ^

Error: Cannot find module 'webpack/lib/ConcatSource'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/lucamormile/Documents/Lavori/Webapps/React/webpack_test/node_modules/extract-text-webpack-plugin/index.js:5:20)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

What did i forgot?

Upvotes: 19

Views: 40702

Answers (5)

linzhi
linzhi

Reputation: 37

I solve it by use

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

Upvotes: 2

Victor Joseph
Victor Joseph

Reputation: 11

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

Upvotes: 1

Play Mobil
Play Mobil

Reputation: 249

Running npm i node-sass might solve your problem

Upvotes: -3

Sandy Duan
Sandy Duan

Reputation: 437

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

npm i extract-text-webpack-plugin

Upvotes: 18

htanjo
htanjo

Reputation: 1154

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.

Upvotes: 20

Related Questions