我正在使用我在这里找到的文档安装vuepress:
这一切都运行得很好。但是,当我运行时:
vuepress dev并转到我的localhost:8080我收到以下错误:
VuePress dev server listening at http://localhost:8080/
(node:44843) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
at processRequest (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
at ready (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/util.js:51:12)
at handleRequest (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/util.js:167:5)
at Promise (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
at new Promise (<anonymous>)
at middleware (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
at Promise.all.Promise (/usr/local/lib/node_modules/vuepress/node_modules/koa-webpack/index.js:43:7)
at new Promise (<anonymous>)
at /usr/local/lib/node_modules/vuepress/node_modules/koa-webpack/index.js:42:5
at dispatch (/usr/local/lib/node_modules/vuepress/node_modules/koa/node_modules/koa-compose/index.js:42:32)
at /usr/local/lib/node_modules/vuepress/node_modules/@shellscape/koa-static/legacy/index.js:58:19
at Generator.throw (<anonymous>)
at step (/usr/local/lib/node_modules/vuepress/node_modules/@shellscape/koa-static/legacy/index.js:6:221)
at _throw (/usr/local/lib/node_modules/vuepress/node_modules/@shellscape/koa-static/legacy/index.js:6:455)
(node:44843) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44843) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.我尝试安装:
npm install webpack-dev-middleware@3.6.0但这并不能解决我的问题。你知道我下一步该怎么做吗?
发布于 2019-04-05 20:40:08
尝试删除vuepress并重新安装(全局)。
sudo npm remove vuepress -g或npm remove vuepress
然后:
sudo npm install vuepress -g
https://stackoverflow.com/questions/55479773
复制相似问题