GitBook部署过程中用到的一些指令

1、安装nodejs
Windows系统从官网 https://nodejs.org/ 下载当前版本的nodejs,执行msi安装文件进行安装。

2、安装GitBook
首先设置npm上网代理

npm config set proxy=http://user:password@proxy_host:proxy_port

注1:在配置时输入的配置命令行都可以在C盘User目录下的用户名目录中的.npmrc找到(用notePad打开)

注2:执行npm指令需要走到 E:\nodejs\node_modules下执行,否则会提示 ‘npm’ 不是内部或外部命令,也不是可运行的程序。

注3:如果仍然报错,则查看是不是环境变量的问题。配置两个环境变量:一个是PATH上增加node.exe的目录D:\nodejs,一个是增加环境变量NODE_PATH ,值为D:\nodejs\node_modules

3、命令行中输入npm set config strict-ssl=false
在.npmrc中表现为 strict-ssl=false

4、设置npm的register

npm add taobao https://registry.npm.taobao.org

在.npmrc中表现为 registry=https://registry.npm.taobao.org 。本身的源下载起来非常慢,因此在这里设置成国内镜像。

5、安装,一定要加上-g,表示全局安装

npm install gitbook-cli -g
#查看node的版本
node --version

6、git clone http://ip/***/***.git

7、提交代码的步骤
提交前先执行 git pull 进行更新,避免冲突。

git add . 
git commit –m "本次提交内容描述"
git push

注:这里有可能报错 empty ident name (for (null)>) not allowed during executing git -c core.
此时需要配置:

git config --global user.email [email protected]
git config --global user.name yourname

猜你喜欢

转载自blog.csdn.net/weixin_38645718/article/details/83756021
今日推荐