V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
xiaohantx
V2EX  ›  问与答

请教一个关于 vuepress 报错的问题....res.getHeader

  •  
  •   xiaohantx · 2019-03-15 14:17:15 +08:00 · 1343 次点击
    这是一个创建于 1870 天前的主题,其中的信息可能已经有所发展或是发生改变。

    具体报错是

    (node:44617) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
    

    搜索了一些方法,尝试了

    npm install [email protected]
    

    以及

    {
      "scripts": {
        "docs:dev": "vuepress dev docs",
        "docs:build": "vuepress build docs"
      },
      "devDependencies": {
        "vuepress": "^0.14.10",
        "webpack-dev-middleware": "3.6.0"
      }
    }
    

    然后 vuepress dev docs 都仍然报错

    4 条回复    2019-03-29 13:07:41 +08:00
    clchenliang
        1
    clchenliang  
       2019-03-29 09:34:43 +08:00
    同出错。
    更换了 vuepress 版本,node 版本都未生效
    xiaohantx
        2
    xiaohantx  
    OP
       2019-03-29 09:41:34 +08:00
    @clchenliang 更换最新版本后,问题已经解决
    clchenliang
        3
    clchenliang  
       2019-03-29 11:24:05 +08:00
    我这边是因为 webpack-dev-middleware 的版本问题。3.6.x 的有这个问题。恢复成 3.4.x 的就可以了。
    你说的更新最新版本是指哪个? vuepress 吗
    xiaohantx
        4
    xiaohantx  
    OP
       2019-03-29 13:07:41 +08:00
    @clchenliang #3 对,别的没动,采用了 1.x 的 vuepress 就没问题了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2897 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 09:02 · PVG 17:02 · LAX 02:02 · JFK 05:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.