- Can't resolve 'sass-loader'
yarn docs:dev
vuepress Can't resolve 'sass-loader'
//需要安裝依賴項
yarn add -D sass-loader node-sass
- Vue packages version mismatch:
yarn docs:build
Vue packages version mismatch:
- vue@2.5.21
- vue-server-renderer@2.5.22
This may cause things to work incorrectly.
Make sure to use the same version for both.
猜測依賴項版本不同
//在package.json中強制制定版本
"devDependencies": {
"vue-server-renderer":"^2.5.21"
}
//或者 更新vue
yarn add vue global
3.vue-loader報錯
yarn docs:build
Error: [vue-loader] vue-template-compiler must be installed
as a peer dependency, or a compatible compiler implementation
must be passed via options.
可能 版本不對
//package.json 將2.5.21 改為
"devDependencies": {
"vue-template-compiler": "^2.5.22",
}
4.渲染組件demo報錯
yarn docs:build
Error rendering /components/button/:
Error: render function or template not defined in component: button-demo
可能組件是按照瀏覽器API渲染的 文檔
//如果你正在使用,或者需要展示一個對于 SSR 不怎么友好的組件(比如包含了自定義指令),
//你可以將它們包裹在內置的 <ClientOnly> 組件中:
<ClientOnly>
<button-demo/>
</ClientOnly>
5.添加部署倉庫目錄
//.vuepress/config.js
module.exports = {
base: '/gulu-xingkongs/'
}
5.部署時給deploy.sh添加權限
chmod +x deploy.sh