gpt4 book ai didi

linux - 在 mozjpeg 上安装 npm 时出错,权限被拒绝?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:17:05 29 4
gpt4 key购买 nike

我正在运行 npm install 并收到以下错误:

> mozjpeg@5.0.0 postinstall /home/MyUser/public_html/node_modules/mozjpeg
> node lib/install.js

⚠ The `/home/MyUser/public_html/node_modules/mozjpeg/vendor/cjpeg` binary doesn't seem to work correctly
⚠ mozjpeg pre-build test failed
ℹ compiling from source
✖ Error: autoreconf -fiv && ./configure --disable-shared --disable-dependency-tracking --with-jpeg8 --prefix="/home/MyUser/public_html/node_modules/mozjpeg/vendor" --bindir="/home/MyUser/public_html/node_modules/mozjpeg/vendor" --libdir="/home/MyUser/public_html/node_modules/mozjpeg/vendor" && make -j4 && make install -j4
Command failed: ./configure --disable-shared --disable-dependency-tracking --with-jpeg8 --prefix="/home/MyUser/public_html/node_modules/mozjpeg/vendor" --bindir="/home/MyUser/public_html/node_modules/mozjpeg/vendor" --libdir="/home/MyUser/public_html/node_modules/mozjpeg/vendor"
/bin/sh: ./configure: Permission denied

at ChildProcess.exithandler (child_process.js:199:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:920:16)
at Socket.<anonymous> (internal/child_process.js:351:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:497:12)

> optipng-bin@3.1.4 postinstall /home/MyUser/public_html/node_modules/optipng-bin
> node lib/install.js

✔ optipng pre-build test passed successfully

> pngquant-bin@4.0.0 postinstall /home/MyUser/public_html/node_modules/pngquant-bin
> node lib/install.js

⚠ The `/home/MyUser/public_html/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 installed
at Promise.all.then.arr (/home/MyUser/public_html/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
at process._tickCallback (internal/process/next_tick.js:109:7)

这似乎是缺少权限,但我不明白为什么。如果我以 root 运行相同的命令,一切正常。我缺少什么权限,我该如何解决?

谢谢。

最佳答案

在 xubuntu 17.10 上也有同样的问题,我所做的是安装 libpng-devsudo apt-get install libpng-dev 然后再次运行 npm install。这解决了我的问题

关于linux - 在 mozjpeg 上安装 npm 时出错,权限被拒绝?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49580185/

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