0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

yarn add cypress が失敗する

Posted at

yarn add -D cypress が失敗するようになってしまいました。

yarn add -D cypress

中略

Installing Cypress (version: 9.1.1)

[STARTED] Task without title.
The Cypress App could not be downloaded.

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

Otherwise, please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop/9.1.1?platform=darwin&arch=x64
Error: read ECONNRESET

----------

Platform: darwin-x64 (20.6.0)
Cypress Version: 9.1.1
[FAILED] The Cypress App could not be downloaded.
[FAILED] 
[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
[FAILED] 
[FAILED] Otherwise, please check network connectivity and try again:
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] URL: https://download.cypress.io/desktop/9.1.1?platform=darwin&arch=x64
[FAILED] Error: read ECONNRESET
[FAILED] 
[FAILED] ----------
[FAILED] 

調べたところ、同様の現象になってしまった人は他にもいるようでした

The Cypress App could not be downloaded (Can't install via NPM I on WINDOWS 2012) · Issue #6315 · cypress-io/cypress

When downloading 2 versions of Cypress simultaneously, one clobbers the other resulting in nondescript error and exit · Issue #4595 · cypress-io/cypress

node_modulesの下

node_modulesの下にはcypressがいるので、add自体が失敗しているわけではなさそうでした。

スクリーンショット 2021-12-16 20.08.21.png

Cypress Runを行うと以下のようなメッセージが表示されました。

No version of Cypress is installed in: /Users/xxxx/Library/Caches/Cypress/9.1.1/Cypress.app

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /Users/xxxx/Library/Caches/Cypress/9.1.1/Cypress.app/Contents/MacOS/Cypress

----------

Platform: darwin-x64 (20.6.0)
Cypress Version: 9.1.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

もしかしたら、Cachesの下にバイナリを置くとうまくいくかもしれない

バイナリ

以下からバイナリをダウンロードしました。

ダウンロードしたCypress.appCachesの下に配置します。

mkdir ~/Library/Caches/Cypress/9.1.1
mv Cypress.app ~/Library/Caches/Cypress/9.1.1/.

yarn

yarnしてみます。

# yarn
yarn install v1.22.17
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.81s.

成功しました!!

Cypress実行

yarn cy:run
yarn run v1.22.17
$ cypress run
It looks like this is your first time using Cypress: 9.1.1

✔  Verified Cypress! /Users/atsu/Library/Caches/Cypress/9.1.1/Cypress.app

Opening Cypress...

無事に起動しました!

なかなか罠でしたが、無事に稼働して一安心です。
なぜ、Caches/Cypress/9.1.1/が消えてしまっていたのかは謎なので、引き続き注視していきます。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?