Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress app gets not installed when dependency is added using yarn #633

Closed
fvanwijk opened this issue Sep 12, 2017 · 14 comments
Closed

Cypress app gets not installed when dependency is added using yarn #633

fvanwijk opened this issue Sep 12, 2017 · 14 comments
Assignees
Labels
cli type: unexpected behavior User expected result, but got another

Comments

@fvanwijk
Copy link
Contributor

  • Operating System: OSX 10.12.6
  • Cypress Version: 0.20
  • Browser Version: n/a

Is this a Feature or Bug?

Bug

Current behavior:

I already have a working Cypress project and I upgraded to 0.20 by reinstalling it locally using yarn

$ yarn add -D cypress

Calling npm cypress:open (= ./node_modules/.bin/cypress open) gives the error that Cypress is not installed yet. I have to install Cypress manually by calling ./node_modules/.bin/cypress install.

Desired behavior:

I want cypress install to trigger automatically after adding with yarn so that it can be opened immediately.

@jennifer-shehane jennifer-shehane added cli type: unexpected behavior User expected result, but got another labels Sep 12, 2017
@bahmutov
Copy link
Contributor

Hmm, we use postinstall script to actually install the binary

@bahmutov
Copy link
Contributor

Might be related to Yarn bug yarnpkg/yarn#853

@kryshenp
Copy link

I had a problem with adding package to my project devDependencies by:

$ yarn add --dev cypress

which returned

error Couldn't find package "@cypress/listr-verbose-renderer" on the "npm" registry.

In my case it has been solved with:

npm install cypress --save-dev

@bahmutov
Copy link
Contributor

Hmm, that looks weird, why wouldn't it find cypress - what version of yarn are you using?

@kryshenp
Copy link

@bahmutov yarn v0.24.6

@bahmutov
Copy link
Contributor

Can you take a look at https://github.com/cypress-io/cypress-test-node-versions ? We are testing Cypress against Node v8 and Yarn v1.0.1 successfully. This is the test run: https://circleci.com/gh/cypress-io/cypress-test-node-versions/139

@pawelgalazka
Copy link

pawelgalazka commented Sep 15, 2017

Works with yarn 0.27.5 and node 6.11.1 without any issues for me

@fvanwijk
Copy link
Contributor Author

I yesterday upgraded Yarn to 1.0.2. I forgot what version I was using (0.24?). Will try again today!

@tonydaly
Copy link

tonydaly commented Oct 5, 2017

I'm having the same issue.

Node: 8.6.0
Yarn: 1.1.0 (latest)

Installing via NPM is fine, but with yarn the node index.js --exec install fails

Output:
node_modules/cypress/node_modules/chalk/index.js:66
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
                                                                         ^

TypeError: Cannot read property 'close' of undefined
    at Object.<anonymous> (node_modules/cypress/node_modules/chalk/index.js:66:74)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)

@bahmutov
Copy link
Contributor

bahmutov commented Oct 5, 2017

@bahmutov bahmutov closed this as completed Oct 5, 2017
@luhmann
Copy link

luhmann commented Nov 1, 2017

I'm having the same issue.

Node: 8.8.1
Yarn: 1.2.1
Cypress: 1.0.3

Steps to reproduce

  1. yarn add cypress --dev
  2. Installation finishes without errors
  3. node_modules/.bin/cypress open

Result
Outputs message:

 -Error-
The Cypress App could not be found.
Expected the app to be found here: /Applications/Cypress.app

To fix this do (one) of the following:
1. Reinstall Cypress with: cypress install
2. If Cypress is stored in another location, move it to the expected location

Doing the recommended cypress install yields:

You are trying to install the latest version of Cypress.

This CLI tool is deprecated and can no longer install versions of Cypress above 0.19.4.

For newer versions, please use the new cypress npm module.

See https://on.cypress.io/installing-cypress for details

Installation with npm 5.4.2 is successful and cypress open yields the expected result

@brian-mann
Copy link
Member

@luhmann that error appears to be coming from our old CLI tools which have been deprecated / removed.

Please uninstall them with npm uninstall -g cypress-cli

There's no reason to ever use that package again.

@luhmann
Copy link

luhmann commented Nov 1, 2017

@brian-mann That fixed it. Thx for the quick response!

@iganzina-epam
Copy link

Had similar issue, getting following error while running yarn install and having "cypress" dependency in package.json:

error Couldn't find package "@cypress/listr-verbose-renderer" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "@cypress/xvfb" on the "npm" registry.

The reason was that in yarn global config I had our company's registry as a default one. So, adding “@cypress:registry” “https://registry.npmjs.org/” to .yarnrc and to .npmrc solved the issue.

@cypress-io cypress-io locked and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

9 participants