运行前端项目报错`...mapGetters`

来源:3-2 user models设计

安生ing

2017-08-31

ansheng@Ubuntu:~/project/Enigma/web$ npm run dev

> webpack-test@1.0.0 dev /home/ansheng/project/Enigma/web
> webpack-dev-server --inline --progress --profile --colors

 10% building modules 1/1 modules 0 active                                         
Project is running at http://localhost:8080/
webpack output is served from /
404s will fallback to /index.html
 47% building modules 315/324 modules 9 active ..._modules/axios/lib/helpers/cookies.jswebpack: wait until bundle finished: /
7754ms building modules                                                                 
22ms sealing
0ms optimizing 
0ms basic module optimization 
5ms module optimization 
0ms advanced module optimization 
1ms basic chunk optimization 
0ms chunk optimization 
0ms advanced chunk optimization 
0ms module and chunk tree optimization 
7ms module reviving 
0ms module order optimization 
2ms module id optimization 
2ms chunk reviving 
0ms chunk order optimization 
12ms chunk id optimization
16ms hashing
1ms module assets processing 
36ms chunk assets processing
12ms additional chunk assets processing
1ms recording 
0ms additional asset processing 
849ms chunk asset optimization
82ms asset optimization
34ms emitting
Hash: 036df2bb5c4f7b8b3528
Version: webpack 2.7.0
Time: 8870ms
                                  Asset       Size  Chunks                    Chunk Names
      static/fonts/iconfont.fcaaa27.eot    11.8 kB          [emitted]         
       static/images/alipay.128a09b.jpg    16.8 kB          [emitted]         
     static/images/loginBg1.23c7104.jpg     475 kB          [emitted]  [big]  
       static/images/xinpin.0abdd07.jpg    83.1 kB          [emitted]         
     static/images/iconfont.8e5fcd4.svg    14.2 kB          [emitted]         
      static/fonts/iconfont.60cf513.ttf    11.6 kB          [emitted]         
    index.036df2bb5c4f7b8b3528.entry.js    2.52 MB       0  [emitted]  [big]  index
index.036df2bb5c4f7b8b3528.entry.js.map    3.39 MB       0  [emitted]         index
                             index.html  235 bytes          [emitted]         
chunk    {0} index.036df2bb5c4f7b8b3528.entry.js, index.036df2bb5c4f7b8b3528.entry.js.map (index) 2.48 MB [entry] [rendered]
    [1] ./~/vue/dist/vue.common.js 268 kB {0} [built]
        [] -> factory:172ms building:532ms dependencies:3ms = 707ms
   [21] ./~/axios/index.js 40 bytes {0} [built]
        [] -> factory:724ms building:270ms = 994ms
   [26] ./src/store/store.js 812 bytes {0} [built]
        [] -> factory:26ms building:184ms dependencies:77ms = 287ms
   [98] ./src/main.js 538 bytes {0} [built]
        [] -> factory:128ms building:774ms = 902ms
   [99] (webpack)-dev-server/client?http://localhost:8080 5.83 kB {0} [built]
        [] -> factory:38ms building:53ms dependencies:816ms = 907ms
  [100] (webpack)/hot/dev-server.js 1.57 kB {0} [built]
        [] -> factory:98ms building:17ms = 115ms
  [161] ./src/axios/index.js 1.01 kB {0} [built]
        [] -> factory:29ms building:249ms dependencies:446ms = 724ms
  [173] ./~/loglevel/lib/loglevel.js 6.74 kB {0} [built]
        [] -> factory:840ms building:219ms = 1059ms
  [209] ./src/styles/common.scss 1.05 kB {0} [built]
        [] -> factory:939ms building:4ms = 943ms
  [211] ./src/styles/fonts/iconfont.css 932 bytes {0} [built]
        [] -> factory:943ms building:1ms dependencies:588ms = 1532ms
  [239] ./~/url/url.js 23.3 kB {0} [built]
        [] -> factory:37ms building:716ms = 753ms
  [246] ./src/App.vue 1.65 kB {0} [built]
        [] -> factory:1294ms building:291ms dependencies:6ms = 1591ms
  [350] (webpack)-dev-server/client/overlay.js 3.6 kB {0} [built]
        [] -> factory:29ms building:296ms = 325ms
  [354] (webpack)/hot/log-apply-result.js 1.02 kB {0} [built]
        [] -> factory:277ms building:518ms = 795ms
  [355] multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js 52 bytes {0} [built]
         factory:0ms building:2ms = 2ms
     + 341 hidden modules

ERROR in ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/views/head/shophead.vue
Module build failed: SyntaxError: Unexpected token (37:4)

  35 | export default {
  36 |   computed: {
> 37 |     ...mapGetters({
     |     ^
  38 |       userInfo:'userInfo'
  39 |     })
  40 |   },

 @ ./src/views/head/shophead.vue 8:2-108
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

ERROR in ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/views/head/head.vue
Module build failed: SyntaxError: Unexpected token (155:8)

  153 |     },
  154 |     computed: {
> 155 |         ...mapGetters({
      |         ^
  156 |           goods_list: 'goods_list',
  157 |           userInfo:'userInfo'
  158 |         })

 @ ./src/views/head/head.vue 8:2-104
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
Child html-webpack-plugin for "index.html":
    chunk    {0} index.html 541 kB [entry] [rendered]
        [0] ./~/lodash/lodash.js 540 kB {0} [built]
            [] -> factory:63ms building:694ms = 757ms
        [1] ./~/html-webpack-plugin/lib/loader.js!./template.html 528 bytes {0} [built]
             factory:46ms building:30ms = 76ms
        [2] (webpack)/buildin/global.js 509 bytes {0} [built]
            [] -> factory:96ms building:18ms = 114ms
        [3] (webpack)/buildin/module.js 517 bytes {0} [built]
            [] -> factory:96ms building:19ms = 115ms
webpack: Failed to compile.
[HPM] Error occurred while trying to proxy request /favicon.ico from localhost:8080 to http://shop.projectsedu.com:8001 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /favicon.ico from localhost:8080 to http://shop.projectsedu.com:8001 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)


写回答

2回答

安生ing

提问者

2017-09-01

已解决,清空npm缓存再次npm install即可

0
1
bobby
好的,
2017-09-01
共1条回复

安生ing

提问者

2017-08-31

//szimg.mukewang.com/59a7a73c0001b20019170899.jpg

$ npm -v
3.5.2
$ node -v
v4.7.2


0
2
安生ing
回复
bobby
确实是运行了cnpm install
2017-09-01
共2条回复

Python前后端分离开发Vue+Django REST framework实战

Django REST framework课程视频,RESTFul API前后端分离开发

2873 学习 · 2457 问题

查看课程