# cd pancake-frontend-master/
# ls
CONTRIBUTING.md crowdin.yml cypress cypress.json doc LICENSE netlify.toml package.json public README.md scripts src static.json tsconfig.json yarn.lock
初始化git
git init
安装所有的依赖包
yarn
项目下多了node_modules依赖包
# ls
CONTRIBUTING.md crowdin.yml cypress cypress.json doc LICENSE netlify.toml node_modules package.json public README.md scripts src static.json tsconfig.json yarn.lock
项目打包
npm run build
编译后的静态页在build中
# ls
build CONTRIBUTING.md crowdin.yml cypress cypress.json doc LICENSE netlify.toml node_modules package.json public README.md scripts src static.json tsconfig.json yarn.lock
三、编译报错解决
3.1 git未安装
报错内容:
Couldn't find the binary git
报错原因:没有安装git
解决方法:
yum -y install git
3.2 nodejs版本低
报错内容:
error extract-files@9.0.0: The engine "node" is incompatible with this module. Expected version "^10.17.0 || ^12.0.0 || >= 13.7.0". Got "10.12.0"
error Found incompatible module.
报错原因:nodejs版本低
解决方法:将node升级至符合以下版本即可,个人本次使用版本为:v12.20.0
^10.17.0 || ^12.0.0 || >= 13.7.0
3.3 git没有初始化
报错内容:
fatal: Not a git repository (or any parent up to mount point /opt)
报错原因:git安裝后没有初始化
解决方法:初始化git
git init
3.4 git无法被找到
报错内容:
.git can't be found (see https://git.io/Jc3F9)
error Command failed with exit code 1.
git无法被找到
解决方法:在源码文件夹路径下初始化git
# git init
Initialized empty Git repository in /opt/tools/pancake-frontend-master/.git/