yarn install fails for optipng-bin behind a proxy - node.js

I've installed a squid-deb-proxy proxy in my local build environment. to build a package with yarn, I'm executing:
yarn install --https-proxy=http://192.168.100.40:8000 --proxy=http://192.168.100.40:8000 --verbose
I've also configured the proxy in ~/.npmrc
proxy=http://192.168.100.40:8000
https-proxy=http://192.168.100.40:8000
https_proxy=http://192.168.100.40:8000
Here the failure:
[4/4] Building fresh packages...
...
[4/5] ⠠ optipng-bin
verbose 23.465307382 ⚠ tunneling socket could not be established, cause=connect ENETUNREACH 0.0.31.64:80 - Local (0.0.0.0:0)
⚠ jpegtran pre-build test failed
ℹ compiling from source
✖ RequestError: tunneling socket could not be established, cause=connect ENETUNREACH 0.0.31.64:80 - Local (0.0.0.0:0)
at ClientRequest.<anonymous> (/opt/jenkinsagent/workspace/line_tmp-v34-jenkins-test-agent2/product/browser-phone/node_modules/got/index.js:111:21)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at ClientRequest.onError (/opt/jenkinsagent/workspace/line_tmp-v34-jenkins-test-agent2/product/browser-phone/node_modules/tunnel-agent/index.js:179:21)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at Socket.socketErrorListener (_http_client.js:469:9)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
The build finally fails when building the optipng-bin package. It looks like this package is not using the proxy. In the proxy-logs I can see that download from other packages use the proxy, only the optipng-bin not.
Any idea what else I can do to force to use the proxy?

I was unable to use yarn install and was getting this same error.
brew install automake fixed it for me
For more help read this link

Related

Yarn Install erroring with "Internal Error: Error when performing the request"

Attempting to install Dependencies for a project. yarn install and npm install both not working. (npm installis working on other projects.)
Running yarn install is returning the error:
Internal Error: Error when performing the request
at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\corepack\dist\corepack.js:16073:20)
at ClientRequest.emit (node:events:512:28)
at TLSSocket.socketErrorListener (node:_http_client:496:9)
at TLSSocket.emit (node:events:512:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
I'm not using a Proxy so any solutions I could find did not work for me.

React native with expo error when running np, start/expo start command

I'm having issues running expo start/npm start/yarn start command. When running these commands it stars to this point.
PS C:\Users\Administrator\Documents\EdwardFiles\javascript\React-projects\demo> yarn start
yarn run v1.22.19
warning ..\..\..\..\..\package.json: No license field
$ expo start
Starting project at C:\Users\Administrator\Documents\EdwardFiles\javascript\React-projects\demo
Developer tools running on http://localhost:19002
Starting Metro Bundler
Then it throws an error below.
C:\Users\Administrator\Documents\EdwardFiles\javascript\React-projects\demo\node_modules\metro-hermes-compiler\src\emhermesc.js:77
throw ex;
^
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at ChildProcess.<anonymous> (C:\Users\Administrator\Documents\EdwardFiles\javascript\React-projects\demo\node_modules\fb-watchman\index.js:205:22)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:527:28)
at Pipe.<anonymous> (node:net:709:12)
Emitted 'error' event on Client instance at:
at ChildProcess.<anonymous> (C:\Users\Administrator\Documents\EdwardFiles\javascript\React-projects\demo\node_modules\fb-watchman\index.js:214:12)
at ChildProcess.emit (node:events:527:28)
[... lines matching original stack trace ...]
at Pipe.<anonymous> (node:net:709:12)
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\Users\Administrator\Documents\EdwardFiles\javascript\React-projects\demo>
I have tried the following.
running npm update
npm audit fix --force
uninstalling metro and fb-watchman
installing metro and fb-watchman manually.
uninstalled node and installed node version 16.16.0 LTS
installed expo-cli
Still facing the same issue.

Protractor Webdriver update error : tunneling socket could not be established, cause=read ECONNRESET

Getting error while updating Webdriver in Protractor.
Tried with proxy setting:
npm config set proxy http:Proxy:port
npm config set http_proxy http:Proxy:port
npm config set https_proxy https:Proxy:port
System info:
Protractor version:5.2.0
npm version:3.10.10
mvn version: 3.5.2
Error:
tunneling socket could not be established, cause=read ECONNRESET
C:\Windows\System32>webdriver-manager update
events.js:160
throw er; // Unhandled 'error' event
^
Error: tunneling socket could not be established, cause=read ECONNRESET
at ClientRequest.onError (C:\Users\a655086\AppData\Roaming\npm\node_modules\
protractor\node_modules\tunnel-agent\index.js:177:17)
at ClientRequest.g (events.js:292:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
C:\Windows\System32>
Looks like duplicate of this. In your attempts mentioned in the OP, I don't see :// after http. Also note that even for https-proxy the protocol is http and not https. If you are not behind any proxy, you need to unset them as mentioned in the linked answer
npm config set proxy http://proxyhost:proxyport
npm config set https-proxy http://proxyhost:proxyport
The issue got resolved by running cmd as administrator using below command
npm config set proxy false
npm cache clean
then restarting cntlm services
Webdriver-manager update

ionic start project connection error (ERRCONNREFUSED)

I have this error when I try to start a new ionic project.
Note:I may have mucked around with proxies at work at some point (behind a proxy), and now it is showing this error at home (direct connection). I'm not sure if this is an issue with proxies for sure though.
The Error:
Creating Ionic app in folder C:\Users\sam\hiya based on tabs project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Error Initializing app: Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80
Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80
at ClientRequest.onError (C:\Users\sam\AppData\Roaming\npm\node_modules\ionic\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
at ClientRequest.g (events.js:260:16)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:267:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80 (CLI v1.7.16)
Your system information:
Cordova CLI: 6.3.0
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
OS:
Node Version: v4.4.5
Your help would be greatly appreciated. Sam
Maybe you can change your default ionicServeAddress on ionic.config file.
On Mac this file is at ~/.ionic. On a PC it can be found at C:/users/username/.ionic. Inside you'll see something like
"ionicServeAddress": "localhost"
Perhaps changing to your proxies ip or localhost might help.

Configure Karma to use global PhantomJS install on Linux Jenkins

I'm trying to get my Karma Unit tests to run on a remote Jenkins server. This Jenkins server is running on Linux with an old version of PhantomJS already installed and PHANTOMJS_BIN defined in the env. I'm using the gulp-karma and karma-phantomjs-launcher-nonet packages to run the karma tests.
However, when jenkins fires Karma, it seems to be unable to spawn PhantomJS. I get the following error:
[13:33:00] Starting Karma server... [32mINFO [karma]: [39mKarma v0.12.37 server started at http://localhost:9876/ [32mINFO [launcher]: [39mStarting browser PhantomJS [31mERROR [karma]: [39m{ [Error: spawn EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'spawn' } Error: spawn EACCES at exports._errnoException (util.js:874:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:339:9) at Object._execCommand (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/process.js:63:21) at Object._start (/appl/jenkins/workspace/ps-lib/node_modules/karma-phantomjs-launcher-nonet/index.js:40:10) at Object. (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/process.js:14:10) at emitOne (events.js:82:20) at Object.emit (events.js:169:7) at Object.start (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/base.js:40:10) at /appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launcher.js:88:15 at Array.forEach (native) at [object Object].launch (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launcher.js:40:11) at [object Object].invoke (/appl/jenkins/workspace/ps-lib/node_modules/karma/node_modules/di/lib/injector.js:75:15) at Server. (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/server.js:62:18) at Server.g (events.js:260:16) at emitNone (events.js:72:20) at Server.emit (events.js:166:7) at emitListeningNT (net.js:1260:10) at doNTCallback1 (node.js:430:9) at process._tickCallback (node.js:352:17)
/appl/jenkins/workspace/ps-lib/tasks/test.js:15 throw err; ^
Error: karma exited with code 1
at done (/appl/jenkins/workspace/ps-lib/node_modules/gulp-karma/index.js:56:30)
at ChildProcess. (/appl/jenkins/workspace/ps-lib/node_modules/gulp-karma/index.js:82:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
So it seems to me that my karma is unable to run PhantomJS due to authorisation reasons, am I right? Still the phantomjs installation is done with user jenkins//jenkins so jenkins should be able to run it, right?

Resources