Webpack-dev-server在Windows上抛出错误
问题描述:
我需要你的帮助,我在https://github.com/ReuvenLiran/Netomedia有一个反应项目。 它在Linux上的伟大工程,但在Windows它抛出一个错误:Webpack-dev-server在Windows上抛出错误
[email protected] start C:\Users\user1\Documents\Dev\Netomedia better-npm-run dev-server
running better-npm-run in C:\Users\user1\Documents\Dev\Netomedia
Executing script: dev-server
to be executed: ./node_modules/.bin/webpack-dev-server --hot --inline --config build/webpack.config.js
net.js:641
throw new TypeError('invalid data');
^
TypeError: invalid data
at WriteStream.Socket.write (net.js:641:11)
at ChildProcess.<anonymous> (C:\Users\user1\Documents\Dev\Netomedia\node_modules\better-npm-run\lib\exec.js:32:18)
at emitOne (events.js:77:13)
at ChildProcess.emit (events.js:169:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
at Function.Module.runMain (module.js:443:11)
at startup (node.js:139:18)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `better-npm-run dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'better-npm-run dev-server'.
npm ERR! This is most likely a problem with the Nettomdeia package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! better-npm-run dev-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs Nettomdeia
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls Nettomdeia
npm ERR! There is likely additional logging output above.
这是什么问题,如何解决呢?
在此先感谢。
答
最后我解决了它。我更新了更好的npm运行到最新版本,我的脚本曾经是'./node_module/.bin/webpack-dev-server'而不是'webpack-dev-server'。 Windows使用路径变量。
可能相关的问题?虽然它看起来已经关闭了。 https://github.com/erikras/react-redux-universal-hot-example/issues/947 – Aelexe
谢谢,我试图升级更好的npm运行,但它没有帮助。 –