npm ERR! PhantomJS not found on PATH-安装phantomj时发生报错

时间:2024-10-11 08:06:28
old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /var/lib/elasticsearch/elasticsearch-head-master/node_modules/phantomjs-prebuilt
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! PhantomJS not found on PATH
npm ERR! Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
npm ERR! Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
npm ERR! Receiving...
npm ERR! Error making request.
npm ERR! Error: connect ETIMEDOUT 20.205.243.166:443
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
npm ERR! 
npm ERR! Please report this full log at https://github.com/Medium/phantomjs

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-10-10T07_33_45_342Z-debug-0.log

首先执行:

[root@elk-node-01 elasticsearch-head-master]# npm install phantomjs@2.1.1 --ignore-scripts

然后再执行:

[root@elk-node-01 elasticsearch-head-master]# npm install