问题场景:使用html-pdf将html转换pdf文件,html-pdf依赖于phantomjs-prebuilt。phantomjs-prebuilt是用来安装PhantomJS的npm 安装器,安装html-pdf时会自动安装该依赖。
然而,安装html-pdf插件的时候遇到了phantomjs-prebuilt装不上的问题:
[root@localhost PROJECTSERVICE]# npm install html-pdf --save
> phantomjs-prebuilt@2.1.16 install /pathto/PROJECTSERVICE/node_modules/phantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Removing /pathto/PROJECTSERVICE/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1544582492513/phantomjs-2.1.1-linux-x86_64 -> /pathto/PROJECTSERVICE/node_modules/phantomjs-prebuilt/lib/phantom
chmod failed