我按照npm的安装方式进行安装,安装过程:
npm install phantomjs-prebuilt
> phantomjs-prebuilt@2.1.15 install /data/wwwroot/qrcode/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 /data/wwwroot/qrcode/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1505540093865/phantomjs-2.1.1-linux-x86_64 -> /data/wwwroot/qrcode/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /data/wwwroot/qrcode/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
npm WARN qrcode@1.0.0 No description
npm WARN qrcode@1.0.0 No repository field.
+ phantomjs-prebuilt@2.1.15
updated 1 package in 28.151s
[root@VM_171_198_centos qrcode]# phantomjs --version
bash: /usr/local/bin/phantomjs: No such file or directory
请问怎么解决这个问题?
已经纠结了一天,starkoverflow上面的也看了试了,解决不了。
wwwroot文件夹的权限是777
你又没有安装到全局,直接输入phantomjs 肯定是不可能成功的。