V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xiaohantx
V2EX  ›  问与答

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

  •  
  •   xiaohantx · Mar 15, 2019 · 1855 views
    This topic created in 2613 days ago, the information mentioned may be changed or developed.

    具体报错是

    (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 replies    2019-03-29 13:07:41 +08:00
    clchenliang
        1
    clchenliang  
       Mar 29, 2019
    同出错。
    更换了 vuepress 版本,node 版本都未生效
    xiaohantx
        2
    xiaohantx  
    OP
       Mar 29, 2019
    @clchenliang 更换最新版本后,问题已经解决
    clchenliang
        3
    clchenliang  
       Mar 29, 2019
    我这边是因为 webpack-dev-middleware 的版本问题。3.6.x 的有这个问题。恢复成 3.4.x 的就可以了。
    你说的更新最新版本是指哪个? vuepress 吗
    xiaohantx
        4
    xiaohantx  
    OP
       Mar 29, 2019
    @clchenliang #3 对,别的没动,采用了 1.x 的 vuepress 就没问题了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5163 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 01:10 · PVG 09:10 · LAX 18:10 · JFK 21:10
    ♥ Do have faith in what you're doing.