执行npm run dev_win之后出现错误。错误代码如下:

来源:4-2 通用JS工具类封装(网络数据请求功能)

zhanghxx

2018-03-31

> mmall-fe@1.0.0 dev_win D:\Git\doc\mmall-fe
> set WEBPACK_ENV=dev && webpack-dev-server --inline --port 8088

dev
 http://localhost:8088/
webpack result is served from /dist
content is served from D:\Git\doc\mmall-fe
Hash: 8c7349749c69058da1d3
Version: webpack 1.15.0
Time: 1291ms
          Asset       Size  Chunks             Chunk Names
     js/base.js     249 kB       0  [emitted]  common
    js/index.js    1.91 kB       1  [emitted]  index
    js/login.js  722 bytes       2  [emitted]  login
view/index.html     1.7 kB          [emitted]
view/login.html  358 bytes          [emitted]
chunk    {0} js/base.js (common) 228 kB [rendered]
    [0] multi common 52 bytes {0} [built]
    [1] (webpack)-dev-server/client?http://localhost:8088 4.16 kB {0} [built]
    [2] ./~/url/url.js 23.3 kB {0} [built]
    [3] ./~/url/~/punycode/punycode.js 14.6 kB {0} [built]
    [4] (webpack)/buildin/module.js 251 bytes {0} [built]
    [5] ./~/url/util.js 314 bytes {0} [built]
    [6] ./~/querystring/index.js 127 bytes {0} [built]
    [7] ./~/querystring/decode.js 2.4 kB {0} [built]
    [8] ./~/querystring/encode.js 2.09 kB {0} [built]
    [9] (webpack)-dev-server/~/strip-ansi/index.js 161 bytes {0} [built]
   [10] (webpack)-dev-server/~/ansi-regex/index.js 135 bytes {0} [built]
   [11] (webpack)-dev-server/client/socket.js 897 bytes {0} [built]
   [12] ./~/sockjs-client/lib/entry.js 244 bytes {0} [built]
   [13] ./~/sockjs-client/lib/transport-list.js 613 bytes {0} [built]
   [14] ./~/sockjs-client/lib/transport/websocket.js 2.72 kB {0} [built]
   [15] ./~/process/browser.js 5.42 kB {0} [built]
   [16] ./~/sockjs-client/lib/utils/event.js 2 kB {0} [built]
   [17] ./~/sockjs-client/lib/utils/random.js 746 bytes {0} [built]
   [18] ./~/sockjs-client/lib/utils/browser-crypto.js 438 bytes {0} [built]
   [19] ./~/sockjs-client/lib/utils/url.js 975 bytes {0} [built]
   [20] ./~/url-parse/index.js 11.5 kB {0} [built]
   [21] ./~/requires-port/index.js 753 bytes {0} [built]
   [22] ./~/url-parse/~/querystringify/index.js 1.51 kB {0} [built]
   [23] ./~/debug/src/browser.js 4.73 kB {0} [built]
   [24] ./~/debug/src/debug.js 4.39 kB {0} [built]
   [25] ./~/ms/index.js 2.76 kB {0} [built]
   [26] ./~/inherits/inherits_browser.js 672 bytes {0} [built]
   [27] ./~/sockjs-client/lib/event/emitter.js 1.27 kB {0} [built]
   [28] ./~/sockjs-client/lib/event/eventtarget.js 1.85 kB {0} [built]
   [29] ./~/sockjs-client/lib/transport/browser/websocket.js 210 bytes {0} [built]
   [30] ./~/sockjs-client/lib/transport/xhr-streaming.js 1.25 kB {0} [built]
   [31] ./~/sockjs-client/lib/transport/lib/ajax-based.js 1.31 kB {0} [built]
   [32] ./~/sockjs-client/lib/transport/lib/sender-receiver.js 1.18 kB {0} [built]
   [33] ./~/sockjs-client/lib/transport/lib/buffered-sender.js 2.3 kB {0} [built]
   [34] ./~/sockjs-client/lib/transport/lib/polling.js 1.32 kB {0} [built]
   [35] ./~/sockjs-client/lib/transport/receiver/xhr.js 1.58 kB {0} [built]
   [36] ./~/sockjs-client/lib/transport/sender/xhr-cors.js 343 bytes {0} [built]
   [37] ./~/sockjs-client/lib/transport/browser/abstract-xhr.js 4.8 kB {0} [built]
   [38] ./~/sockjs-client/lib/transport/sender/xhr-local.js 352 bytes {0} [built]
   [39] ./~/sockjs-client/lib/utils/browser.js 560 bytes {0} [built]
   [40] ./~/sockjs-client/lib/transport/xdr-streaming.js 984 bytes {0} [built]
   [41] ./~/sockjs-client/lib/transport/sender/xdr.js 2.46 kB {0} [built]
   [42] ./~/sockjs-client/lib/transport/eventsource.js 766 bytes {0} [built]
   [43] ./~/sockjs-client/lib/transport/receiver/eventsource.js 1.58 kB {0} [built]
   [44] ./~/sockjs-client/lib/transport/browser/eventsource.js 37 bytes {0} [built]
   [45] ./~/sockjs-client/lib/transport/lib/iframe-wrap.js 981 bytes {0} [built]
   [46] ./~/sockjs-client/lib/transport/iframe.js 3.83 kB {0} [built]
   [47] ./~/json3/lib/json3.js 43.3 kB {0} [built]
   [48] (webpack)/buildin/amd-options.js 43 bytes {0} [built]
   [49] ./~/sockjs-client/lib/version.js 26 bytes {0} [built]
   [50] ./~/sockjs-client/lib/utils/iframe.js 5.03 kB {0} [built]
   [51] ./~/sockjs-client/lib/utils/object.js 532 bytes {0} [built]
   [52] ./~/sockjs-client/lib/transport/htmlfile.js 710 bytes {0} [built]
   [53] ./~/sockjs-client/lib/transport/receiver/htmlfile.js 2.2 kB {0} [built]
   [54] ./~/sockjs-client/lib/transport/xhr-polling.js 894 bytes {0} [built]
   [55] ./~/sockjs-client/lib/transport/xdr-polling.js 712 bytes {0} [built]
   [56] ./~/sockjs-client/lib/transport/jsonp-polling.js 1.02 kB {0} [built]
   [57] ./~/sockjs-client/lib/transport/receiver/jsonp.js 5.57 kB {0} [built]
   [58] ./~/sockjs-client/lib/transport/sender/jsonp.js 2.46 kB {0} [built]
   [59] ./~/sockjs-client/lib/main.js 11.9 kB {0} [built]
   [60] ./~/sockjs-client/lib/shims.js 17.2 kB {0} [built]
   [61] ./~/sockjs-client/lib/utils/escape.js 2.36 kB {0} [built]
   [62] ./~/sockjs-client/lib/utils/transport.js 1.35 kB {0} [built]
   [63] ./~/sockjs-client/lib/utils/log.js 450 bytes {0} [built]
   [64] ./~/sockjs-client/lib/event/event.js 477 bytes {0} [built]
   [65] ./~/sockjs-client/lib/location.js 177 bytes {0} [built]
   [66] ./~/sockjs-client/lib/event/close.js 295 bytes {0} [built]
   [67] ./~/sockjs-client/lib/event/trans-message.js 292 bytes {0} [built]
   [68] ./~/sockjs-client/lib/info-receiver.js 2.22 kB {0} [built]
   [69] ./~/sockjs-client/lib/transport/sender/xhr-fake.js 456 bytes {0} [built]
   [70] ./~/sockjs-client/lib/info-iframe.js 1.52 kB {0} [built]
   [71] ./~/sockjs-client/lib/info-iframe-receiver.js 791 bytes {0} [built]
   [72] ./~/sockjs-client/lib/info-ajax.js 1.03 kB {0} [built]
   [73] ./~/sockjs-client/lib/iframe-bootstrap.js 2.9 kB {0} [built]
   [74] ./~/sockjs-client/lib/facade.js 723 bytes {0} [built]
   [75] ./src/page/common/index.js 182 bytes {0} [built]
   [76] (webpack)-dev-server/client?http://localhost:8088/ 4.16 kB {0} [built]
chunk    {1} js/index.js (index) 1.58 kB {0} [rendered]
    [0] multi index 40 bytes {1} [built]
   [77] ./src/page/index/index.js 200 bytes {1} [built]
   [78] ./src/util/mm.js 1.34 kB {1} [built]
chunk    {2} js/login.js (login) 435 bytes {0} [rendered]
    [0] multi login 40 bytes {2} [built]
   [79] ./src/page/login/index.js 204 bytes {2} [built]
   [80] ./src/page/module.js 191 bytes {2} [built]

ERROR in   Error: Child compilation failed:
  Module build failed: SyntaxError: Unexpected token =

  - Function

  - lodash.js:14856
    [mmall-fe]/[lodash]/lodash.js:14856:16

  - lodash.js:465 apply
    [mmall-fe]/[lodash]/lodash.js:465:27

  - lodash.js:15240
    [mmall-fe]/[lodash]/lodash.js:15240:16

  - lodash.js:467 apply
    [mmall-fe]/[lodash]/lodash.js:467:27

  - lodash.js:6575
    [mmall-fe]/[lodash]/lodash.js:6575:16

  - lodash.js:14855 Function.template
    [mmall-fe]/[lodash]/lodash.js:14855:20


  - SyntaxError: Unexpected token =

  - compiler.js:79 childCompiler.runAsChild
    [mmall-fe]/[html-webpack-plugin]/lib/compiler.js:79:16

  - Compiler.js:214 Compiler.<anonymous>
    [mmall-fe]/[webpack]/lib/Compiler.js:214:10

  - Compiler.js:403
    [mmall-fe]/[webpack]/lib/Compiler.js:403:12

  - Tapable.js:67 Compiler.next
    [mmall-fe]/[tapable]/lib/Tapable.js:67:11

  - CachePlugin.js:40 Compiler.<anonymous>
    [mmall-fe]/[webpack]/lib/CachePlugin.js:40:4

  - Tapable.js:71 Compiler.applyPluginsAsync
    [mmall-fe]/[tapable]/lib/Tapable.js:71:13

  - Compiler.js:400 Compiler.<anonymous>
    [mmall-fe]/[webpack]/lib/Compiler.js:400:9

  - Compilation.js:577 Compilation.<anonymous>
    [mmall-fe]/[webpack]/lib/Compilation.js:577:13

  - Tapable.js:60 Compilation.applyPluginsAsync
    [mmall-fe]/[tapable]/lib/Tapable.js:60:69

  - Compilation.js:572 Compilation.<anonymous>
    [mmall-fe]/[webpack]/lib/Compilation.js:572:10


Child html-webpack-plugin for "view\index.html":

    ERROR in ./~/html-webpack-plugin/lib/loader.js!./src/view/index.html
    Module build failed: SyntaxError: Unexpected token =
        at Function (<anonymous>)
        at D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:14856:16
        at apply (D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:465:27)
        at D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:15240:16
        at apply (D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:467:27)
        at D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:6575:16
        at Function.template (D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:14855:20)
        at Object.module.exports (D:\Git\doc\mmall-fe\node_modules\html-webpack-plugin\lib\loader.js:32:22)
Child html-webpack-plugin for "view\login.html":
    chunk    {0} view/login.html 540 kB [rendered]
        [0] ./~/html-webpack-plugin/lib/loader.js!./src/view/login.html 566 bytes {0} [built]
        [1] ./~/lodash/lodash.js 540 kB {0} [built]
        [2] (webpack)/buildin/module.js 251 bytes {0} [built]
webpack: Failed to compile

写回答

3回答

Rosen

2018-04-03

回复里的问题是端口在被占用,用任务管理器结束node进程再启动就好了

0
1
zhanghxx
非常感谢!
2018-04-03
共1条回复

zhanghxx

提问者

2018-04-03

关闭node程序之后就是这样:

  ERROR in   Error: Child compilation failed:
  Module build failed: SyntaxError: Unexpected token =

  - Function

  - lodash.js:14856
    [mmall-fe]/[lodash]/lodash.js:14856:16

  - lodash.js:465 apply
    [mmall-fe]/[lodash]/lodash.js:465:27

  - lodash.js:15240
    [mmall-fe]/[lodash]/lodash.js:15240:16

  - lodash.js:467 apply
    [mmall-fe]/[lodash]/lodash.js:467:27

  - lodash.js:6575
    [mmall-fe]/[lodash]/lodash.js:6575:16

  - lodash.js:14855 Function.template
    [mmall-fe]/[lodash]/lodash.js:14855:20


  - SyntaxError: Unexpected token =

  - compiler.js:79 childCompiler.runAsChild
    [mmall-fe]/[html-webpack-plugin]/lib/compiler.js:79:16

  - Compiler.js:214 Compiler.<anonymous>
    [mmall-fe]/[webpack]/lib/Compiler.js:214:10

  - Compiler.js:403
    [mmall-fe]/[webpack]/lib/Compiler.js:403:12

  - Tapable.js:67 Compiler.next
    [mmall-fe]/[tapable]/lib/Tapable.js:67:11

  - CachePlugin.js:40 Compiler.<anonymous>
    [mmall-fe]/[webpack]/lib/CachePlugin.js:40:4

  - Tapable.js:71 Compiler.applyPluginsAsync
    [mmall-fe]/[tapable]/lib/Tapable.js:71:13

  - Compiler.js:400 Compiler.<anonymous>
    [mmall-fe]/[webpack]/lib/Compiler.js:400:9

  - Compilation.js:577 Compilation.<anonymous>
    [mmall-fe]/[webpack]/lib/Compilation.js:577:13

  - Tapable.js:60 Compilation.applyPluginsAsync
    [mmall-fe]/[tapable]/lib/Tapable.js:60:69

  - Compilation.js:572 Compilation.<anonymous>
    [mmall-fe]/[webpack]/lib/Compilation.js:572:10


Child html-webpack-plugin for "view\index.html":

    ERROR in ./~/html-webpack-plugin/lib/loader.js!./src/view/index.html
    Module build failed: SyntaxError: Unexpected token =
        at Function (<anonymous>)
        at D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:14856:16
        at apply (D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:465:27)
        at D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:15240:16
        at apply (D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:467:27)
        at D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:6575:16
        at Function.template (D:\Git\doc\mmall-fe\node_modules\lodash\lodash.js:                                                                                                                14855:20)
        at Object.module.exports (D:\Git\doc\mmall-fe\node_modules\html-webpack-                                                                                                                plugin\lib\loader.js:32:22)
Child html-webpack-plugin for "view\login.html":
    chunk    {0} view/login.html 540 kB [rendered]
        [0] ./~/html-webpack-plugin/lib/loader.js!./src/view/login.html 566 byte                                                                                                                s {0} [built]
        [1] ./~/lodash/lodash.js 540 kB {0} [built]
        [2] (webpack)/buildin/module.js 251 bytes {0} [built]
webpack: Failed to compile.

0
0

zhanghxx

提问者

2018-03-31

解决了一部分问题之后是这个样子的:

dev
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:8088
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1367:14)
    at listenInCluster (net.js:1408:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1517:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mmall-fe@1.0.0 dev_win: `set WEBPACK_ENV=dev && webpack-dev-server --inline --port 8088`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmall-fe@1.0.0 dev_win 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\Administrator\AppData\Roaming\npm-cache\_logs\2018-03-31T02_20_51_965Z-debug.log

0
0

真实数据对接 从0开发前后端分离的企业级上线项目

【毕设项目精品】前端实战,对接真实服务端数据,开发完整项目

4262 学习 · 4113 问题

查看课程