Could not start webpack Dev Server


#1

I followed instructions on the https://redash.io/help-onpremise/dev/docker.html.
And stuck with setup of webpack.

macbook-pro-3:redash kot$ npm start

redash-client@3.0.0 start /Users/kot/git/python/redash
webpack-dev-server

Project is running at http://localhost:8080/
webpack output is served from /
Content not from webpack is served from /Users/kot/git/python/redash/client/app
404s will fallback to /index.html
internal/child_process.js:319
throw errnoException(err, ‘spawn’);
^

Error: spawn EACCES
at exports._errnoException (util.js:1050:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at exports.spawn (child_process.js:378:9)
at Object.exports.execFile (child_process.js:143:15)
at Object.module.exports.fileCommand (/Users/kot/git/python/redash/node_modules/node-notifier/lib/utils.js:53:13)
at NotificationCenter.notify (/Users/kot/git/python/redash/node_modules/node-notifier/notifiers/notificationcenter.js:66:11)
at WebpackBuildNotifierPlugin.onCompilationDone (/Users/kot/git/python/redash/node_modules/webpack-build-notifier/index.js:152:18)
at Compiler.applyPlugins (/Users/kot/git/python/redash/node_modules/tapable/lib/Tapable.js:61:14)
at Watching._done (/Users/kot/git/python/redash/node_modules/webpack/lib/Compiler.js:98:16)
at /Users/kot/git/python/redash/node_modules/webpack/lib/Compiler.js:73:18
at Compiler.emitRecords (/Users/kot/git/python/redash/node_modules/webpack/lib/Compiler.js:367:37)
at /Users/kot/git/python/redash/node_modules/webpack/lib/Compiler.js:56:19
at /Users/kot/git/python/redash/node_modules/webpack/lib/Compiler.js:360:11
at next (/Users/kot/git/python/redash/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/Users/kot/git/python/redash/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/Users/kot/git/python/redash/node_modules/tapable/lib/Tapable.js:222:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! redash-client@3.0.0 start: webpack-dev-server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redash-client@3.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! /Users/kot/.npm/_logs/2017-09-15T20_04_18_219Z-debug.log`

2017-09-15T20_04_18_219Z-debug.log:
0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using npm@5.4.0 3 info using node@v7.9.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle redash-client@3.0.0~prestart: redash-client@3.0.0 6 info lifecycle redash-client@3.0.0~start: redash-client@3.0.0 7 verbose lifecycle redash-client@3.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle redash-client@3.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/kot/git/python/redash/node_modules/.bin:/opt/local/bin:/usr/local/sbin/:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS 9 verbose lifecycle redash-client@3.0.0~start: CWD: /Users/kot/git/python/redash 10 silly lifecycle redash-client@3.0.0~start: Args: [ '-c', 'webpack-dev-server' ] 11 silly lifecycle redash-client@3.0.0~start: Returned: code: 1 signal: null 12 info lifecycle redash-client@3.0.0~start: Failed to exec start script 13 verbose stack Error: redash-client@3.0.0 start:webpack-dev-server13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16) 13 verbose stack at emitTwo (events.js:106:13) 13 verbose stack at EventEmitter.emit (events.js:194:7) 13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at emitTwo (events.js:106:13) 13 verbose stack at ChildProcess.emit (events.js:194:7) 13 verbose stack at maybeClose (internal/child_process.js:899:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 14 verbose pkgid redash-client@3.0.0 15 verbose cwd /Users/kot/git/python/redash 16 verbose Darwin 16.7.0 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 18 verbose node v7.9.0 19 verbose npm v5.4.0 20 error code ELIFECYCLE 21 error errno 1 22 error redash-client@3.0.0 start:webpack-dev-server22 error Exit status 1 23 error Failed at the redash-client@3.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 ]

I tried to remove node_modules && reinstall with npm install. It didn’t help :frowning:

Also I tried to execute webpack-dev-server directly:

kot$ webpack-dev-server
Invalid configuration object. webpack-dev-server has been initialised using a configuration object that does not match the API schema.

  • configuration has an unknown property ‘error’. These properties are valid:
    object { hot?, hotOnly?, lazy?, bonjour?, host?, allowedHosts?, filename?, publicPath?, port?, socket?, watchOptions?, headers?, clientLogLevel?, overlay?, progress?, key?, cert?, ca?, pfx?, pfxPassphrase?, requestCert?, inline?, disableHostCheck?, public?, https?, contentBase?, watchContentBase?, open?, useLocalIp?, openPage?, features?, compress?, proxy?, historyApiFallback?, staticOptions?, setup?, stats?, reporter?, noInfo?, quiet?, serverSideRender?, index?, log?, warn? }

#2

Ok, I solve the problem:

  1. update node to v7.10.1
  2. clean npm cache
  3. rm node_modules
  4. npm i

Now I’m expecting another problem:
$ npm run build

redash-client@3.0.0 build /Users/kot/git/python/t2/redash
rm -rf ./client/dist/ && NODE_ENV=production node node_modules/.bin/webpack

Hash: 2c18853529de3a248d55
Version: webpack 2.7.0
Time: 1218ms
Asset Size Chunks Chunk Names
app.f188f8b699ccb9fc1f47.js 930 bytes 0 [emitted] app
manifest.f02fa98bafb241cc0f6e.js 1.48 kB 1 [emitted] manifest
app.f188f8b699ccb9fc1f47.js.map 1.26 kB 0 [emitted] app
manifest.f02fa98bafb241cc0f6e.js.map 14.5 kB 1 [emitted] manifest
index.html 723 bytes [emitted]
multi_org.html 735 bytes [emitted]
[0] ./client/app/index.js 838 bytes {0} [built] [failed] [1 error]

ERROR in ./client/app/index.js
Module build failed: TypeError: Cannot read property ‘length’ of undefined
at Traverser.traverse (/Users/kot/git/python/t2/redash/node_modules/estraverse/estraverse.js:411:37)
at Traverser.traverse (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/util/traverser.js:31:22)
at EventEmitter.module.exports.api.verify (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/eslint.js:926:23)
at processText (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/cli-engine.js:264:31)
at CLIEngine.executeOnText (/Users/kot/git/python/t2/redash/node_modules/eslint/lib/cli-engine.js:754:26)
at lint (/Users/kot/git/python/t2/redash/node_modules/eslint-loader/index.js:218:17)
at Object.module.exports (/Users/kot/git/python/t2/redash/node_modules/eslint-loader/index.js:213:21)
Child html-webpack-plugin for “multi_org.html”:
[0] ./~/html-webpack-plugin/lib/loader.js!./client/app/multi_org.html 654 bytes {0} [built]
Child html-webpack-plugin for “index.html”:
[0] ./~/lodash/lodash.js 540 kB {0} [built]
[1] ./~/html-webpack-plugin/lib/loader.js!./client/app/index.html 946 bytes {0} [built]
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
[3] (webpack)/buildin/module.js 517 bytes {0} [built]

And this issue is related to:

  1. https://github.com/getredash/redash/issues/1589
  2. https://github.com/getredash/redash/issues/1578#issuecomment-326128982 (updated 16 days ago)