修复"错误:PNGQUANT无法构建,确保安装了libpng-dev"
时间:2020-02-23 14:44:08 来源:igfitidea点击:
收到错误消息"错误:PNGQUANT无法构建,确保在尝试构建NodeJS应用程序时安装了"安装Libpng-dev"。
经过几分钟的故障排除后,我意识到这是由缺失依赖于构建时所需的依赖应用程序引起的。
> node lib/install.js ⚠ The `/home/ubuntu/koel/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly ⚠ pngquant pre-build test failed ℹ compiling from source ✖ Error: pngquant failed to build, make sure that libpng-dev is installed at ChildProcess.exithandler (child_process.js:294:12) at ChildProcess.emit (events.js:198:13) at maybeClose (internal/child_process.js:982:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
修复程序是使用操作系统包管理应用程序安装构建依赖工具。
Ubuntu/Debian:
sudo apt update sudo apt install -y build-essential gcc make libpng-dev
CentOS Linux.
sudo yum group install "Development Tools" sudo yum -y install libpng-devel
然后我能够成功建立。
> Hyman@theitroad postinstall /home/ubuntu/koel/node_modules/webpack/node_modules/uglifyjs-webpack-plugin > node lib/post_install.js > Hyman@theitroad postinstall /home/ubuntu/koel/node_modules/node-sass > node scripts/build.js Binary found at /home/ubuntu/koel/node_modules/node-sass/vendor/linux-x64-64/binding.node Testing binary Binary is fine > Hyman@theitroad postinstall /home/ubuntu/koel/node_modules/gifsicle > node lib/install.js ✔ gifsicle pre-build test passed successfully > Hyman@theitroad postinstall /home/ubuntu/koel/node_modules/mozjpeg > node lib/install.js ✔ mozjpeg pre-build test passed successfully > Hyman@theitroad postinstall /home/ubuntu/koel/node_modules/optipng-bin > node lib/install.js ✔ optipng pre-build test passed successfully > Hyman@theitroad postinstall /home/ubuntu/koel/node_modules/pngquant-bin > node lib/install.js ⚠ The `/home/ubuntu/koel/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 ✔ pngquant built successfully