ubuntu 18.04 npm install 遇到的pngquant-bin 问题

遇到的问题

npm install

> pngquant-bin@4.0.0 postinstall /var/www/tax_client/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/var/www/tax_client/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installedpngquant-bin
    at Promise.all.then.arr (/var/www/tax_client/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
/var/www/tax_client
├─┬ babel-core@6.26.3
│ └── source-map@0.5.7 
├─┬ style-loader@0.13.2
│ └─┬ loader-utils@1.2.3 
│   ├── big.js@5.2.2 
│   └─┬ json5@1.0.1 
│     └── minimist@1.2.0 
└─┬ vue-loader@13.7.3

  ├─┬ loader-utils@1.2.3 
  │ ├── big.js@5.2.2 
  │ └─┬ json5@1.0.1 
  │   └── minimist@1.2.0 
  └─┬ postcss-load-config@1.2.0
    └─┬ cosmiconfig@2.2.2
      └── minimist@1.2.0 

npm WARN optional Skipping failed optional dependency /browser-sync/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /watchpack/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /webpack-dev-server/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm ERR! Linux 4.15.0-65-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! pngquant-bin@4.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pngquant-bin@4.0.0 postinstall script 'node lib/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pngquant-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node lib/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pngquant-bin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls pngquant-bin
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/tax_client/npm-debug.log

解决方式

sudo apt-get install libpng-dev # 安装依赖的软件
npm install pngquant-bin        # 覆盖4.00版本,升级倒5.02
npm install                     # 使用5.02 版本执行


#执行日志
> pngquant-bin@5.0.2 postinstall /var/www/tax_client/node_modules/pngquant-bin
> node lib/install.js

  ✔ pngquant pre-build test passed successfully

/var/www/tax_client
└── pngquant-bin@5.0.2  extraneous

npm WARN optional Skipping failed optional dependency /browser-sync/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /watchpack/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /webpack-dev-server/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值