为什么npm试图安装phantomjs?

时间:2017-07-22 20:00:59

标签: node.js npm phantomjs

我找不到解决方案:我只是在我的pi(raspian)上设置了一个新的Linux发行版,并希望用一个npm命令安装这些软件包:

  

npm install telegraf blocktrail-sdk http请求cookie-parser express-ipfilter googleapis express body-parser cron firebase-admin

几秒钟后,我看到npm尝试安装一个名为phantomjs的软件包,并最终收到此错误消息:

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

> phantomjs@1.9.20 install /home/pi/node_modules/phantomjs
> node install.js

PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally

现在奇怪的是,当我尝试逐个安装这些软件包时:

  

npm install telegraf ... npm install blocktrail-sdk和其他

它不需要安装phantomjs作为依赖项。但为什么要尝试安装呢?我错过了什么?

任何帮助都会非常棒!谢谢!

1 个答案:

答案 0 :(得分:2)

phantomjs包是您正在安装的blocktrail-sdk包的子依赖项。

$ npm ls phantomjs
`-- blocktrail-sdk@3.0.14
  `-- html-pdf@1.0.0
    `-- phantomjs@1.9.20

issue phantomjs无法为Linux / ARM平台找到二进制文件。

解决方法可能是克隆blocktrail-sdk存储库,从html-pdf中的dependencies字段中删除package.json,然后在本地安装:npm install "../path/to/blocktrail-sdk"