webpack.config.js
var ExtractTextPlugin = require("extract-text-webpack-plugin");
Ich erhalte sofort diese Fehlermeldung, wenn ich nur das Plugin implementiere:
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)
Was habe ich vergessen?
Haben Sie ein webpack
-Modul in Ihrem Projekt?
Wenn dies nicht der Fall ist, installieren Sie es lokal (nicht global):
$ npm install webpack [--save-dev]
extract-text-webpack-plugin
benötigt webpack
als Peer-Abhängigkeit, aber npm 3 installiert Peer-Abhängigkeiten nicht automatisch.
Sie können diesen Befehl ausprobieren, den ich unter https://www.npmjs.com/package/extract-text-webpack-plugin gefunden habe.
npm i extract-text-webpack-plugin
Ich löse es durch Verwendung
Verwenden Sie $ npm i -D [email protected]
und dies würde Ihr Problem lösen
Lassen Sie mich wissen, ob dies funktioniert hat.