VuePress初体验

VuePress初体验

安装YarnYarn 是为了弥补 npm 的一些缺陷而生的具体参考:https://zhuanlan.zhihu.com/p/27449990引导式安装下载地址使用Windows版的下载安装即可bash安装在bash里面不能显示,在bash里面下载npm install -g yarn 即可将...

2020年12月21日
184字
13 阅读

安装Yarn

Yarn 是为了弥补 npm 的一些缺陷而生的

具体参考:https://zhuanlan.zhihu.com/p/27449990

引导式安装

下载地址

使用Windows版的下载安装即可

bash安装

在bash里面不能显示,在bash里面下载

npm install -g yarn 即可

将 VuePress 安装为本地依赖

yarn init

yarn init 出错

error An unexpected error occurred: "Can't answer a question unless a user TTY". info If you think t


使用cmd或者power shell不要使用bash


yarn add -D vuepress

创建一篇文章

在bash创建,在powershell里面创建会报错

mkdir docs && echo '# Hello VuePress' > docs/README.md

添加脚本

{
  "name": "my-site",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "vuepress": "^1.7.1"
  },
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "docs:build": "vuepress build docs"
  }
}

运行

端口访问:http://localhost:8080/


文章评论区

欢迎留言交流

未登录,请先注册或登录后发表评论。

Leave comment