目录
1. 版本不同报错
Vue packages version mismatch:
- vue@3.3.4
- vue-server-renderer@2.7.14
This may cause things to work incorrectly. Make sure to use the same version for both.
解决办法:
只要重新安装跟 vue-server-renderer 版本一样的 vue 就可以了
npm uninstall vue
npm install vue@2.7.14
因为 VuePress 只支持 Vue2,如果想要用 Vue3 的话就改成用 VitePress
2.出现乱码
跟着官方文档一步步做,终于可以了但出现乱码!!!
看了网上的办法,其实直接把之前跟着教程创建的 README.md 删了,然后自己再创建一个 README.md 就可以了
3. 引入 config.js 文件出错
wait Extracting site metadata...
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\deskTop\baseui\docs\.vuepress\config.js from D:\deskTop\base-ui\node_modules\@vuepress\core\lib\node\loadConfig.js not supported.
根据报错里面的提示
在 package.json 里把 "type": "module" 改成 "type": "commonjs"