纱线:安装错误:无法确定隧道插座,原因= Connect Econnnenrefuse 127.0.0.1:80
我有next.js应用,在部署站立之前,它在公司服务器上构建,我们分别使用代理,我
yarn config set proxy http://xx.xxx.xx:xxxx
yarn config set httpsProxy http://xx.xxx.xx:xxxx
yarn config set httpProxy http://xx.xxx.xx:xxxx
yarn config set https-proxy http://xx.xxx.xx:xxxx
yarn config set https_proxy http://xx.xxx.xx:xxxx
yarn config set http-proxy http://xx.xxx.xx:xxxx
yarn config set http_proxy http://xx.xxx.xx:xxxx
不幸地使用了纱线代理,它无济于事,我仍然看到构建过程中的
[5/5] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /app/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /app/node_modules/sharp
Output:
sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linuxmusl-x64.tar.br
sharp: Installation error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
错误就像从纱线注册表中安装的软件包没有问题一样。 你有什么想法吗?
I have next.js app, before deploying to stand it builds on company servers, where we use a proxy, respectively I'm using the proxy for yarn
yarn config set proxy http://xx.xxx.xx:xxxx
yarn config set httpsProxy http://xx.xxx.xx:xxxx
yarn config set httpProxy http://xx.xxx.xx:xxxx
yarn config set https-proxy http://xx.xxx.xx:xxxx
yarn config set https_proxy http://xx.xxx.xx:xxxx
yarn config set http-proxy http://xx.xxx.xx:xxxx
yarn config set http_proxy http://xx.xxx.xx:xxxx
Unfortunately, it doesn't help and I still see the error during the build
[5/5] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /app/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /app/node_modules/sharp
Output:
sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linuxmusl-x64.tar.br
sharp: Installation error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
It seems like there are no problems with packages that were installed from yarn registry.
Do you have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也有类似的问题,试图在代理后面安装NPM锋利的软件包,无法在Etimeout上下载Libvips。
您可以将
libvips*.tar.br
从错误的链接下载到本地计算机,然后将下载的文件移至存储库。然后,在项目root(在其中运行
npm i
命令)创建空文件名为.npmrc
和pastesharp_libvips_local_prebuilds =“ libvips-# 。
请注意,这就是敏锐的文档您可能需要更新下载的文件(例如,夏普版本更新和req。新的libvips)。或冻结锋利的版本。
另外,如果您的本地env与服务器(Windows X Linux)不同,则它将无法使用(可能
Had similar problem, trying to install npm sharp package behind proxy failed on downloading libvips on ETIMEOUT.
You can download
libvips*.tar.br
from the link in error to your local computer and then move downloaded file to repository.Then, in project root (where you run
npm i
command) create empty file named.npmrc
and pastesharp_libvips_local_prebuilds="libvips-#YOUR_VERSION_HERE#-#YOUR_ENV#.tar.br"
inside (just copypaste file name).Note this is just what is in sharp documentation and in future, you may need to update the downloaded file (eg when sharp version update and req. newer libvips). Or freeze sharp version.
Also, if your local env is different from server (windows x linux), it won't work (probably????) - check documentation about this.
You can also try asking your IT (whose are taking care of proxy) if they can somehow add url of libvips source to "whitelist" so your local npm i command could access it.
Any better approach is welcome.
PS noted that youre using yarn instead npm so you will need
.yarnrc
or similar file instead.npmrc
.