2

I am using a .npmrc with the following setup for a proxy:

proxy=http://localhost:8887
https-proxy=http://localhost:8887
strict-ssl=false

But running this statement:

npm  install @lvce-editor/ripgrep

results in this error:

npm  install @lvce-editor/ripgrep
npm error code 1
npm error path /home/jupyter/node_modules/@lvce-editor/ripgrep
npm error command failed
npm error command sh -c node ./src/postinstall.js
npm error node:internal/process/promises:394
npm error     triggerUncaughtException(err, true /* fromPromise */);
npm error     ^
npm error
npm error VError: Failed to download "https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-10/ripgrep-v13.0.0-10-x86_64-unknown-linux-musl.tar.gz": RequestError: connect ETIMEDOUT IP:443
npm error     at ClientRequest.<anonymous> (file:///home/jupyter/node_modules/got/dist/source/core/index.js:673:107)
npm error     at Object.onceWrapper (node:events:639:26)
npm error     at ClientRequest.emit (node:events:536:35)
npm error     at emitErrorEvent (node:_http_client:104:11)
npm error     at TLSSocket.socketErrorListener (node:_http_client:512:5)
npm error     at TLSSocket.emit (node:events:524:28)
npm error     at emitErrorNT (node:internal/streams/destroy:170:8)
npm error     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
npm error     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1615:16) {
npm error   code: 'ETIMEDOUT'
npm error }
npm error
npm error Node.js v22.12.0

Same issue occurs when I use

npm --https-proxy=http://localhost:8887  
npm install @lvce-editor/ripgrep

I also tried to use proxy env variable capitalized or not without success. I have also a .gitigire config and all config seems to be ignore by npm when it download stuff from Github directly

Any idea how to fix this issue?

0

1 Answer 1

1

lvce-editor/ripgrep internally downloads from "https://github.com/microsoft/ripgrep-prebuilt/releases/xxx" without using a proxy, so configuring npm or system proxies is ineffective. One possible approach is to use global-agent to force all HTTP/HTTPS requests to go through a proxy at the Node layer:

npm install -g global-agent
export GLOBAL_AGENT_HTTP_PROXY="YOUR_PRXOY"
export NODE_OPTIONS="-r $(npm root -g)/global-agent/bootstrap"

Then try:

npm install @lvce-editor/ripgrep
Sign up to request clarification or add additional context in comments.

1 Comment

I'm using Windows. How can I get it to work?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.