簡體   English   中英

使用 ZScaler 代理安裝 cypress

[英]Installing cypress with ZScaler Proxy

當我嘗試在 Windows 10 機器上使用 Zscaler Cloud Connector 安裝 Cypress 時,我收到以下錯誤:

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

我按照https://on.cypress.io/proxy-configuration的建議,設置 HTTP_PROXY 環境變量以匹配代理設置的腳本地址中顯示的內容。 (這里顯示在 cmd 提示符中):

C:\Windows\system32>echo %HTTP_PROXY%
http://127.0.0.1:9000/systemproxy-9a8d7abc.pac

我嘗試在設置環境變量后使用新的 Power Shell 提示符安裝 cypress,以防我的舊 Power Shell 提示符有一個陳舊的環境。

但是,我仍然遇到同樣的錯誤。 在 Zscaler 設置中,我嘗試暫時關閉服務狀態,但它仍然失敗並出現同樣的錯誤。

我能夠根據此處的說明提出解決方法: 通過命令安裝賽普拉斯時:npm install cypress --save-dev getting error as The Cypress App could not be download

在 cmd 我跑了:

set CYPRESS_INSTALL_BINARY=C:\Users\eric\Downloads\cypress.zip

其次是:

npm install cypress --save-dev

我嘗試在電源 shell 中執行此操作,但如果我運行:

set CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip
dir env:

它不會在我的環境中向我顯示 CYPRESS_INSTALL_BINARY。

注意我不得不在cmd中切換到絕對路徑,因為看不懂~

然后我意識到我需要一個舊版本的柏樹,所以我嘗試做一個:

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

但它似乎沒有完全卸載,因為我看到:

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

我意識到雖然 npm cypress 卸載似乎有效。 我仍然在 C:\Users\eric\AppData\Local\Cypress 目錄中留下了文件。 https://download.cypress.io/desktop/9.6.1下載之后,我刪除了這些文件並重新安裝了 cypress 9.6.1

set CYPRESS_INSTALL_BINARY=C:\Users\eric\Downloads\cypress_old.zip

然后一個

npm install cypress

我能夠跑

npx cypress run

沒有它抱怨

Cypress version 10.0.0 no longer supports cypress.json.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM