Installing cypress with ZScaler Proxy - cypress

When I'm trying to install Cypress with the Zscaler Cloud Connector on a Windows 10 machine, I get the following error:
911 error
911 error Platform: win32-x64 (10.0.19044)
911 error Cypress Version: 10.7.0
912 error [FAILED] The Cypress App could not be downloaded.
912 error [FAILED]
912 error [FAILED] Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
912 error [FAILED]
912 error [FAILED] Otherwise, please check network connectivity and try again:
912 error [FAILED]
912 error [FAILED] ----------
912 error [FAILED]
912 error [FAILED] URL: https://download.cypress.io/desktop/10.7.0?platform=win32&arch=x64
912 error [FAILED] Error: unable to get local issuer certificate
912 error [FAILED]
912 error [FAILED] ----------
912 error [FAILED]
912 error [FAILED] Platform: win32-x64 (10.0.19044)
912 error [FAILED] Cypress Version: 10.7.0
913 verbose exit 1
914 timing npm Completed in 11016ms
915 verbose unfinished npm timer reify 1661966146931
916 verbose unfinished npm timer reify:build 1661966156229
917 verbose unfinished npm timer build 1661966156230
918 verbose unfinished npm timer build:deps 1661966156230
919 verbose unfinished npm timer build:run:postinstall 1661966156255
920 verbose unfinished npm timer build:run:postinstall:node_modules/cypress 1661966156255
921 verbose code 1
922 error A complete log of this run can be found in:
922 error C:\Users\eric\AppData\Local\npm-cache\_logs\2022-08-31T17_15_46_738Z-debug-0.log
I followed the suggestions at https://on.cypress.io/proxy-configuration and set the HTTP_PROXY environment variable to match what's displayed in the Script address of the Proxy Settings. (Here it is displayed in a cmd prompt):
C:\Windows\system32>echo %HTTP_PROXY%
http://127.0.0.1:9000/systemproxy-9a8d7abc.pac
I've tried installing cypress using a new Power Shell prompt after setting the environment variable, in case my old Power Shell prompt had a stale environment.
However, I still get the same error. In the Zscaler settings I've tried temporarily turning off the Service Status, but it still fails with the same error.
I was able to come up with a workaround based on the instructions here: while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded
In cmd I ran:
set CYPRESS_INSTALL_BINARY=C:\Users\eric\Downloads\cypress.zip
followed by:
npm install cypress --save-dev
I tried doing it in power shell, but if I ran a:
set CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip
dir env:
It wouldn't show me the CYPRESS_INSTALL_BINARY in my environment.
Note that I had to switch to an absolute path in cmd, because it didn't understand ~
I then realized that I needed an older version of cypress, so I tried doing a:
npm uninstall cypress
up to date, audited 509 packages in 970ms
62 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
but it doesn't seem to have fully uninstalled, because I see:
c:\MyPath>npx cypress run
There is a cypress.json file at the path: c:\MyPath
Cypress version 10.0.0 no longer supports cypress.json.
Please run cypress open to launch the migration tool to migrate to cypress.config.{js,ts,mjs,cjs}.
https://on.cypress.io/migration-guide

I realized that although the npm cypress uninstall appeared to have worked. I still had files left in the C:\Users\eric\AppData\Local\Cypress directory. I deleted these files and reinstalled cypress 9.6.1 after downloading it from https://download.cypress.io/desktop/9.6.1 Doing a
set CYPRESS_INSTALL_BINARY=C:\Users\eric\Downloads\cypress_old.zip
and then a
npm install cypress
and I was able to run
npx cypress run
without it complaing that
Cypress version 10.0.0 no longer supports cypress.json.

Related

Cypress not openeing the Test runner on execution of command node_modules/.bin/cypress open

On execution of command node_modules/.bin/cypress open it gives below error-
I have installed cypress using npm package only
npm -i init
npm install cypress --save-dev
When I checked the Cache folder - C:\Users\usename\AppData\Local\Cypress\Cache\10.6.0\Cypress
Cypress.exe file is present, but not open when command executed (node_modules/.bin/cypress open)
Cypress version installed is 10.6.0
Error-
It looks like you are running the Cypress binary directly.
This is not the recommended approach, and Cypress may not work correctly.
Please install the cypress NPM package and follow the instructions here:
https://on.cypress.io/installing-cypress
use: "npx cypress open" command

vue awesome swiper install failed on windows

I'm trying to install vue-awesome-swiper with npm using this command
npm i vue-awesome-swiper --save
I'm getting this error
npm ERR! Line breaks can't be quoted on Windows
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USERNAME\AppData\Local\npm-cache\_logs\2021-04-06T18_35_21_789Z-debug.log
I opened the log and I figured that the problem is caused by this line here
80 info run swiper#5.4.5 postinstall node_modules/swiper echo "[35m[1mLove Swiper? Support Vladimir's work by donating or pledging on patreon:[22m[39m
80 info run > [32mhttps://patreon.com/vladimirkharlampidi[0m
80 info run "
As you can see from the log here it's triggering postinstall script and it's just trying to print a message to support the package author.
To fix this issue you can simply install the package without running any scripts with the --ignore-scripts flag like this:
npm i vue-awesome-swiper --save --ignore-scripts

HyperLedger: Error when starting a Business Network

I'm following the Developer Tutorial (https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial). When I try to start the Business using -
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card, this is the error I see:
Starting business network tutorial-network at version 0.0.1
Processing these Network Admins:
userName: admin
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/composer-common failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-05-21T20_15_54_162Z-debug.log
"
Command failed
Error message
I'm on composer v0.19.5. This was helpful, but didn't solve my issue. I have successfully installed the network, starting it is the issue!
see the answer below -
Error in starting hyperledger fabric network with hyperledger composer
During the chaincode build, Fabric does an npm install. Looks like you're behind a proxy (npm install not being able to access https://registry.npmjs.org/ suggests you're behind a proxy and therefore it can't resolve the URL above (to pull down a Composer npm module/dependency during install)). So you would need to provide an npmrc file - in the composer network install command sequence - so that it can configure the behaviour of the npm install - and access a known registry, like https://registry.npmjs.org/ . See more information on this here -> https://hyperledger.github.io/composer/latest/managing/connector-information
example might be:
proxy="http://172.10.117.21:3128/"
https-proxy="http://172.10.117.31:3128/"
registry = "http://registry.npmjs.org/"

IONIC UPDATE ERROR 243 on mac

? The Ionic CLI has an update available (3.19.0 => 3.19.1)! Would you like to in
stall it? Yes
npm i -g ionic#latest
✖ Running command - failed!
[ERROR] An error occurred while running npm i -g ionic#latest (exit code 243):
since mac having access issue this error will pop up.so what you have to do is run it as admin it will popup for administrator password.request update as below command in terminal
sudo npm i -g ionic#latest

npm command create-react-app failled

I am trying to test reactjs on my computer (mbp pro 2017) running OsX sierra 10.12.6.
I have followed the Facebook tutorial:
Make sure you have a recent version of Node.js installed. (done)
Follow the installation instructions to create a new project. https://facebook.github.io/react/docs/installation.html#creating-a-new-application
But i have a problem on this second step !
I am not behind a proxy.
my network is ok.
The repository is set to registry.npmjs.org
i can read the url : https://registry.npmjs.org/create-react-app
But this domain is not found even on external DNS wsg.intra.corp.grp
I'am stuck, any help will be nice !
$ npm install -g create-react-app
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2017-09-01T08_15_13_521Z-debug.log
And the log file :
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'create-react-app' ]
2 info using npm#5.3.0
3 info using node#v8.4.0
4 verbose npm-session 4811d091ad74f9ef
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for create-react-app#latest request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
8 verbose type system
9 verbose stack FetchError: request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
9 verbose stack at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
9 verbose stack at emitOne (events.js:115:13)
9 verbose stack at ClientRequest.emit (events.js:210:7)
9 verbose stack at onerror (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/index.js:106:9)
9 verbose stack at callbackError (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/index.js:126:5)
9 verbose stack at <anonymous>
9 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
10 verbose cwd /Users/franckfournier/PycharmProjects/projectX/react
11 verbose Darwin 16.7.0
12 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app"
13 verbose node v8.4.0
14 verbose npm v5.3.0
15 error code ENOTFOUND
16 error errno ENOTFOUND
17 error network request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo ENOTFOUND wsg.intra.corp.grp wsg.intra.corp.grp:8080
18 error network This is a problem related to network connectivity.
18 error network In most cases you are behind a proxy or have bad network settings.
18 error network
18 error network If you are behind a proxy, please make sure that the
18 error network 'proxy' config is set properly. See: 'npm help config'
19 verbose exit [ 1, true ]
You seem to be behind a corporate proxy, as wsg.intra.corp.grp:8080 is mentioned in the logs.
You need to configure the proxy like shown in this guide.
Hope this helps!
Run below commands on your command prompt. Make sure node and npm are installed.
npm config rm proxy
npm config rm https-proxy
open this link in your browser: https://registry.npmjs.org/
Run below command to set registry.
npm config set registry https://registry.npmjs.org/
Hope its help : )
I solved this issue just by,
go to settings>Network and Internet>Proxy and then off Automatically detect settings under Automatic proxy setup on Windows. And then the installation worked fine.
Following this post on Github, and adding "104.18.95.96 registry.npmjs.org" to my /etc/hosts solved my problem.
If you still face issues follow these steps:
Go to Settings > Network and Internet > Proxy and find out the address and port
Go to command prompt or terminal depending on your machine(tip: hit Win + R and type cmd). In the command prompt type the following commands
npm config set proxy http://usernamepassword#proxy-server-url:port
npm config set https-proxy http://usernamepassword#proxy-server-url:port
Username and password really isn’t needed 9 times out of 10, the last 2 will suffice. Proxy-server-url is your address and your port is the port number. Once it’s set close command prompt and re-open it. And voila! you can now install all your packages
Source: https://medium.com/#ogbemudiatimothy/using-npm-install-behind-a-corporate-proxy-server-db150c128899

Resources