gpt4 book ai didi

node.js - npm install gifsicle behind corporate proxy 失败或卡在 Windows 系统

转载 作者:搜寻专家 更新时间:2023-11-01 00:04:51 28 4
gpt4 key购买 nike

Windows 7,npm@3.10.3, Node @v6.7.0

npm 和 git 设置为使用企业代理。我花了一段时间才弄清楚 git 和 npm 如何使用公司代理,幸运的是它成功完成了。npm 配置文件 (.npmrc) 如下所示:

strict-ssl=false
proxy=http://domain%5Cmyname:mypassword@corporateproxy:8088/
http-proxy=http://domain%5Cmyname:mypassword@corporateproxy:8088/
https-proxy=http://domain%5Cmyname:mypassword@corporateproxy:8088/
cache-lock-wait=30000
cache-lock-retries=10
cache-lock-stale=300000

开始安装

npm install gifsicle --verbose

这是日志:

C:\temp\2018_0110\estatico>npm install gifsicle --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\temp\\TOOLS\\PortableNode\\node.exe',
npm verb cli 'C:\\temp\\TOOLS\\PortableNode\\node_modules\\npm\\bin\\npm-cli.j
s',
npm verb cli 'install',
npm verb cli 'gifsicle',
npm verb cli '--verbose' ]
npm info using npm@3.10.3
npm info using node@v6.7.0
npm verb request uri https://registry.npmjs.org/gifsicle
npm verb request no auth needed
npm info attempt registry request try #1 at 09:00:29
npm verb request id 7014dcca318052d1
npm verb etag "5a108ad8-73b8"
npm verb lastModified Sat, 18 Nov 2017 19:32:40 GMT
npm http request GET https://registry.npmjs.org/gifsicle
npm http 304 https://registry.npmjs.org/gifsicle
npm verb headers { date: 'Wed, 17 Jan 2018 08:00:14 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: '"5a108ad8-73b8"',
npm verb headers age: '13585',
npm verb headers connection: 'close',
npm verb headers 'x-served-by': 'cache-hhn1546-HHN',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '10',
npm verb headers 'x-timer': 'S1516176014.461012,VS0,VE0',
npm verb headers vary: 'Accept-Encoding, Accept' }
npm verb etag https://registry.npmjs.org/gifsicle from cache
npm verb get saving gifsicle to C:\Users\MYUSERHOME\AppData\Roaming\npm-cach
e\registry.npmjs.org\gifsicle\.cache.json
npm verb correctMkdir C:\Users\MYUSERHOME\AppData\Roaming\npm-cache correctM
kdir not in flight; initializing
npm verb cache add spec gifsicle
npm verb addNamed "latest" is being treated as a dist-tag for gifsicle
npm info addNameTag [ 'gifsicle', 'latest' ]
npm verb addNameTag registry:https://registry.npmjs.org/gifsicle not in flight;
fetching
npm verb get https://registry.npmjs.org/gifsicle not expired, no request
npm verb addNamed "3.0.4" is a plain semver version for gifsicle
npm verb afterAdd C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\gifsicle\3.0
.4\package\package.json not in flight; writing
npm verb correctMkdir C:\Users\MYUSERHOME\AppData\Roaming\npm-cache correctM
kdir not in flight; initializing
npm verb afterAdd C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\gifsicle\3.0
.4\package\package.json written
npm verb correctMkdir C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\_locks c
orrectMkdir not in flight; initializing
npm verb lock using C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\_locks\sta
ging-fdad36d07e8f1a67.lock for C:\temp\2018_0110\estatico\node_modules\.staging
npm verb unbuild node_modules\.staging\gifsicle-c326b995
npm verb gentlyRm don't care about contents; nuking C:\temp\2018_0110\estatico\n
ode_modules\.staging\gifsicle-c326b995
npm verb tar unpack C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\gifsicle\3
.0.4\package.tgz
npm verb tar unpacking to C:\temp\2018_0110\estatico\node_modules\.staging\gifsi
cle-c326b995
npm verb gentlyRm don't care about contents; nuking C:\temp\2018_0110\estatico\n
ode_modules\.staging\gifsicle-c326b995
npm verb gentlyRm don't care about contents; nuking C:\temp\2018_0110\estatico\n
ode_modules\.staging\gifsicle-c326b995\node_modules
npm info lifecycle gifsicle@3.0.4~preinstall: gifsicle@3.0.4
npm info linkStuff gifsicle@3.0.4
npm verb linkBins gifsicle@3.0.4
npm verb link bins [ { gifsicle: 'cli.js' },
npm verb link bins 'C:\\temp\\2018_0110\\estatico\\node_modules\\.bin',
npm verb link bins false ]
npm verb linkMans gifsicle@3.0.4
npm info lifecycle gifsicle@3.0.4~install: gifsicle@3.0.4
npm info lifecycle gifsicle@3.0.4~postinstall: gifsicle@3.0.4

> gifsicle@3.0.4 postinstall C:\temp\2018_0110\estatico\node_modules\gifsicle
> node lib/install.js

1.) 安装在 gifsicle@3.0.4 安装后脚本“node lib/install.js”中停滞了很长时间。

2.)15 分钟或更长时间后下一条消息

  ‼ tunneling socket could not be established, cause=read ECONNRESET
‼ gifsicle pre-build test failed
i compiling from source

3.) 最后一条消息

× RequestError: tunneling socket could not be established, cause=socket hang u
p
at ClientRequest.<anonymous> (C:\temp\2018_0110\estatico\node_modules\got\in
dex.js:74:21)
at ClientRequest.g (events.js:291:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at ClientRequest.onError (C:\temp\2018_0110\estatico\node_modules\caw\node_m
odules\tunnel-agent\index.js:178:21)
at ClientRequest.g (events.js:291:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:308:9)
at emitOne (events.js:96:13)
npm verb lifecycle gifsicle@3.0.4~postinstall: unsafe-perm in lifecycle true
npm verb lifecycle gifsicle@3.0.4~postinstall: PATH: C:\temp\TOOLS\PortableNode\
node_modules\npm\bin\node-gyp-bin;C:\temp\2018_0110\estatico\node_modules\gifsic
le\node_modules\.bin;C:\temp\2018_0110\estatico\node_modules\.bin;C:\temp\TOOLS\
PortableNode;C:\temp\TOOLS\PortableNode;C:\temp\TOOLS\PortableGit\cmd;C:\Program
Files (x86)\MQSeries Client\Java\lib;C:\ProgramData\Oracle\Java\javapath;C:\Win
dows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPow
erShell\v1.0\;C:\Program Files (x86)\CTV_V7_E-I\isiscomm\w3\lib;C:\Program Files
(x86)\MQSeries Client\bin64;C:\Program Files (x86)\MQSeries Client\bin;C:\Progr
am Files (x86)\MQSeries Client\tools\c\samples\bin;C:\Program Files\Citrix\Syste
m32\;C:\Program Files\Citrix\ICAService\;C:\Program Files (x86)\UltraEdit\;C:\Pr
ogram files\IBM\sqllib\bin;C:\Program files\IBM\sqllib\funtion;C:\Program Files
(x86)\Subversion;C:\Program Files\TortoiseSVN\bin;C:\Users\MYUSERHOME\.dnx\b
in;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\
Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Bin
n\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\
McAfee\MOVE AV Client\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Fi
les (x86)\TAA\taaseu;C:\Program Files (x86)\UltraEdit
npm verb lifecycle gifsicle@3.0.4~postinstall: CWD: C:\temp\2018_0110\estatico\n
ode_modules\gifsicle
npm verb unlock done using C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\_lo
cks\staging-fdad36d07e8f1a67.lock for C:\temp\2018_0110\estatico\node_modules\.s
taging
estatico@5.0.0 C:\temp\2018_0110\estatico
`-- gulp-imagemin@3.0.3
`-- imagemin-gifsicle@5.2.0
`-- gifsicle@3.0.4

npm verb exit [ 0, true ]
npm info ok

虽然将触发安装 node-gyp,但似乎未使用 npm 的代理设置。

我可以在另一台计算机上成功安装 gifsicle,并且在 direkt internet 连接中没有任何问题。

问:有没有人在企业代理后面成功安装gifsicle,请告诉我是怎么做到的?

编辑:这是它至少卡住的部分。C:\temp\estatico\node_modules\gifsicle\lib>node install.js --verbose

'use strict';
var BinBuild = require('bin-build');
var log = require('logalot');
var bin = require('./');

bin.run(['--version'], function (err) {
if (err) {
log.warn(err.message);
log.warn('gifsicle pre-build test failed');
log.info('compiling from source');

var cfg = [
'./configure --disable-gifview --disable-gifdiff',
'--prefix="' + bin.dest() + '" --bindir="' + bin.dest() + '"'
].join(' ');

var builder = new BinBuild()
.src('https://github.com/kohler/gifsicle/archive/v1.88.tar.gz')
.cmd('autoreconf -ivf')
.cmd(cfg)
.cmd('make install');

return builder.run(function (err) {
if (err) {
log.error(err.stack);
return;
}

log.success('gifsicle built successfully');
});
}

log.success('gifsicle pre-build test passed successfully');
});

最佳答案

要通过防火墙安装 npm 包,我发现我需要设置代理环境变量而不是使用 npm config。这似乎随​​着 npm 的不同版本而有所改变。我目前设置了“http_proxy”和“https_proxy”,这似乎涵盖了我使用的所有 npm 版本。

我没用过gifsicle

关于node.js - npm install gifsicle behind corporate proxy 失败或卡在 Windows 系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48297849/

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