- Can't resolve 'sass-loader'
yarn docs:dev
vuepress Can't resolve 'sass-loader'
//需要安裝依賴(lài)項(xiàng)
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.
猜測(cè)依賴(lài)項(xiàng)版本不同
//在package.json中強(qiáng)制制定版本
"devDependencies": {
"vue-server-renderer":"^2.5.21"
}
//或者 更新vue
yarn add vue global
3.vue-loader報(bào)錯(cuò)
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.
可能 版本不對(duì)
//package.json 將2.5.21 改為
"devDependencies": {
"vue-template-compiler": "^2.5.22",
}
4.渲染組件demo報(bào)錯(cuò)
yarn docs:build
Error rendering /components/button/:
Error: render function or template not defined in component: button-demo
可能組件是按照瀏覽器API渲染的 文檔
//如果你正在使用搓幌,或者需要展示一個(gè)對(duì)于 SSR 不怎么友好的組件(比如包含了自定義指令)幕庐,
//你可以將它們包裹在內(nèi)置的 <ClientOnly> 組件中:
<ClientOnly>
<button-demo/>
</ClientOnly>
5.添加部署倉(cāng)庫(kù)目錄
//.vuepress/config.js
module.exports = {
base: '/gulu-xingkongs/'
}
5.部署時(shí)給deploy.sh添加權(quán)限
chmod +x deploy.sh