###下載 wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz ### 解壓 tar xvf node-v10.15.3-linux-x64.tar.xz ### 剪切 mv node-v10.15.3-linux-x64 /usr/local/node
添加環境變量node
cat >> /etc/profile << EOF ## add node export NODE_HOME=/usr/local/node export PATH=$PATH:$NODE_HOME/bin export NODE_PATH=$NODE_HOME/lib/node_modules EOF source /etc/profile
git clone https://github.com/mobz/elasticsearch-head.git cd elasticsearch-head npm install ###若上一步出錯,需忽略phantomjs-prebuilt@2.1.16,則執行 npm install phantomjs-prebuilt@2.1.16 --ignore-scripts ## 修改es地址爲實際地址 _site/app.js ### 啓動 npm run start