從GitHub上獲取最新代碼,切換分支到最新穩(wěn)定版本7.2.1,基于該版本進(jìn)行二次開發(fā)。
開發(fā)環(huán)境:MacOS
取完代碼后,進(jìn)入代碼目錄,執(zhí)行如下命令:
$ brew install node@12
編輯.npmrc
$ vi ~/.npmrc
添加如下內(nèi)容:
sass_binary_site = https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl = https://npm.taobao.org/mirrors/phantomjs/
registry = http://registry.npm.taobao.org
編輯.bash_profile
vi ~/.bash_profile
添加如下內(nèi)容:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH=/usr/local/Cellar/node@12/12.19.0_1/bin:$PATH
export CLASSPATH
export GOPROXY=https://goproxy.io
export GO111MODULE=on
開始編譯
$ yarn config set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD 1
$ yarn install --pure-lockfile
$ yarn start
安裝完golang之后,再開一個窗口執(zhí)行
$ make run
訪問http://localhost:3000,用VSCode進(jìn)行二次開發(fā)。
注:如果報錯Fail to watch directory($WORKDIR/pkg/tsdb) too many open files,執(zhí)行如下命令:
ulimit -S -n 2048