1. 程式人生 > >安裝phantomjs報錯解決

安裝phantomjs報錯解決

前言

最近有個專案要搞下jenkins自構建,微服務中註冊中心用了jhipster registry,需要編譯前端程式碼。
yarn執行過程中, PhantomJS解壓安裝報錯。

找度娘問了下,提供包的很少,要麼速度賊慢;要麼藏著掖著,要積分;要麼方法不行,吐槽下o(╯□╰)o。

後來重新看了下包,其實是解壓方式有問題,這個bz2字尾其實是假的,總結了下方法。

1. 下載包

https://npm.taobao.org/mirrors/phantomjs 這個下面針對不同版本和作業系統包很多,自己找需要的。

wget https://npm.taobao.org/mirrors/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2

2. 解壓包

tar -xvf   phantomjs-2.1.1-linux-x86_64.tar.bz2

3. 軟連結一下

ln -s /usr/local/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/

phantomjs -v

\(^o^)/~ 了 !!!