简体   繁体   English

为什么npm尝试安装phantomjs?

[英]why does npm tries to install phantomjs?

I can't find a solution: I just set up a new Linux distro on my pi (raspian) and wanted to install those packages with one npm command: 我找不到解决方案:我只是在pi(树莓派)上设置了一个新的Linux发行版,并希望使用一个npm命令安装这些软件包:

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

After a few seconds I see that npm tries to install a package called phantomjs and ends up with this error message: 几秒钟后,我看到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

Now the weird thing is, that when I try to install these packages one by one: 现在奇怪的是,当我尝试一一安装这些软件包时:

npm install telegraf ... npm install blocktrail-sdk and the other ones npm install telegraf ... npm install blocktrail-sdk和其他的

it does not need to install phantomjs as a dependency. 它不需要安装phantomjs作为依赖项。 But why does it try to install it? 但是为什么要尝试安装呢? What am I missing? 我想念什么?

Any help would be really great! 任何帮助都将非常棒! Thanks! 谢谢!

The phantomjs package is a sub-dependency of the blocktrail-sdk package you are installing. phantomjs软件包是您正在安装的blocktrail-sdk软件包的子依赖项。

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

The issue is that phantomjs can't find a binary for Linux/ARM platforms. 问题phantomjs找不到Linux / ARM平台的二进制文件。

A workaround could be to clone the blocktrail-sdk repo, remove html-pdf from the dependencies field in the package.json , and then install it locally: npm install "../path/to/blocktrail-sdk" . 一种解决方法是克隆blocktrail-sdk库,从package.jsondependencies字段中删除html-pdf ,然后在本地npm install "../path/to/blocktrail-sdk"npm install "../path/to/blocktrail-sdk"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM