gpt4 book ai didi

npm 安装错误 : libpng-dev

转载 作者:行者123 更新时间:2023-12-04 19:30:18 26 4
gpt4 key购买 nike

OS: centos-release-6-10.el6.centos.12.3.x86_64

Node version: v8.11.1

NPM version: 5.6.0



包.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.2.0",
"laravel-mix": "^2.0",
"lodash": "^4.17.4"
}
}

当我尝试运行 npm install它停止并出现以下错误:-
⚠ The `/home/dipengrg/project/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work corr
ectly
⚠ 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 installed
at Promise.all.then.arr (/home/dipengrg/project/node_modules/pngquant-bin/node_modules/bin-build/node_m
odules/execa/index.js:231:11)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (c
urrent: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
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.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

如果我尝试使用 npm install libpng-dev 安装 libpng-dev它报告:-
npm ERR! code E404
npm ERR! 404 Not Found: libpng-dev@latest

我跟着试过 this solution但问题仍然存在。

最佳答案

由于您运行的是 CentOS,因此您需要的软件包实际上是 libpng-devel .您可以通过运行 yum -y install libpng-devel 来安装它. libpng-dev是一个 Ubuntu/Debian 软件包,它与 libpng-devel 几乎相同(用于 CentOS/RedHat 发行版)。您正在尝试使用 npm 安装 linux 软件包,因此很明显您会收到 404(未找到)错误,因为 nodejs/npm 不存在该软件包。

所以先安装libpng-devel,然后重新运行npm install看看情况如何。

关于npm 安装错误 : libpng-dev,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51833949/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com