webpack - wstępna konfiguracja

0

witam
stworzyłem hello world według tego wpisu http://bedekodzic.pl/webpack/
w konsoli wyświetlają się takie błędy, co zrobiłem źle?

C:\Users\User\Desktop\Test>npm start

> Test@1.0.0 start C:\Users\User\Desktop\Test
> webpack-dev-server

C:\Users\User\Desktop\Test\node_modules\schema-utils\dist\validateOptions.js:40
    throw new _ValidationError2.default(ajv.errors, name);
    ^
false
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Test@1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Test@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2017-12-17T21_16_28_101Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@5.5.1
3 info using node@v9.2.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle Test@1.0.0~prestart: Test@1.0.0
6 info lifecycle Test@1.0.0~start: Test@1.0.0
7 verbose lifecycle Test@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle Test@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\User\Desktop\Test\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Roaming\npm
9 verbose lifecycle Test@1.0.0~start: CWD: C:\Users\User\Desktop\Test
10 silly lifecycle Test@1.0.0~start: Args: [ '/d /s /c', 'webpack-dev-server' ]
11 silly lifecycle Test@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle Test@1.0.0~start: Failed to exec start script
13 verbose stack Error: Test@1.0.0 start: `webpack-dev-server`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
13 verbose stack     at EventEmitter.emit (events.js:159:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:159:13)
13 verbose stack     at maybeClose (internal/child_process.js:943:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid Test@1.0.0
15 verbose cwd C:\Users\User\Desktop\Test
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v9.2.1
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error Test@1.0.0 start: `webpack-dev-server`
22 error Exit status 1
23 error Failed at the Test@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

gdzieś w internecie przeczytałem, że webpack jest łatwy w konfigurowaniu ale jak widać to nie jest prawda
projekt jest w załączinku

0

A jakiego WebPacka zainstalowales? Wydaje mi sie, ze pomieszles wersje, konfig ktorego uzywasz dla extract-text-webpack-plugin wyglada jak dla wersji 1, a pewnie sciagnales 2?

https://github.com/webpack-contrib/extract-text-webpack-plugin

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

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: ExtractTextPlugin.extract({
          fallback: "style-loader",
          use: "css-loader"
        })
      }
    ]
  },
  plugins: [
    new ExtractTextPlugin("styles.css"),
  ]
}

vs
https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/webpack-1/README.md

var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
	module: {
		loaders: [
			{ test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }
		]
	},
	plugins: [
		new ExtractTextPlugin("styles.css")
	]
}

1 użytkowników online, w tym zalogowanych: 0, gości: 1