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

Cannot start on Ubuntu - /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")") #16378

Closed
2 of 10 tasks
lukebelliveau opened this issue May 6, 2021 · 3 comments
Labels
stale no activity on this issue for a long period topic: installation Issue during installation or downloading Cypress

Comments

@lukebelliveau
Copy link

Have a question? Start a new discussion 👉 https://github.com/cypress-io/cypress/discussions

Fill in as much info as possible. As an open source project with a small maintainer team, it may take some time for your issue to be addressed. Please be patient and we will respond as soon as we can. 🙏 -->

Current behavior

I am trying to install and use Cypress on Ubuntu 20.04. I have done the following from my project folder:

$ sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
$ npm install cypress --save-dev
$ npx cypress open

The last command returns the following:

It looks like this is your first time using Cypress: 7.2.0

  ✖  Verifying Cypress can run /home/ubuntu/.cache/Cypress/7.2.0/Cypress
    → Cypress Version: 7.2.0
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------

/home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")")

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 7.2.0

Not sure what's going on. $ ./node_modules/.bin/cypress open has the same result.

Debug logs

cypress:cli:cli cli starts with arguments ["/home/ubuntu/.nvm/versions/node/v14.16.0/bin/node","/home/ubuntu/ROBOT/nuwave/iris-console/node_modules/.bin/cypress","run"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +2ms
  cypress:cli:cli running Cypress with args [ Command { _events: [Object: null prototype] { 'option:browser': [Function (anonymous)], 'option:ci-build-id': [Function (anonymous)], 'option:config': [Function (anonymous)], 'option:config-file': [Function (anonymous)], 'option:env': [Function (anonymous)], 'option:group': [Function (anonymous)], 'option:key': [Function (anonymous)], 'option:headed': [Function (anonymous)], 'option:headless': [Function (anonymous)], 'option:no-exit': [Function (anonymous)], 'option:parallel': [Function (anonymous)], 'option:port': [Function (anonymous)], 'option:project': [Function (anonymous)], 'option:quiet': [Function (anonymous)], 'option:record': [Function (anonymous)], 'option:reporter': [Function (anonymous)], 'option:reporter-options': [Function (anonymous)], 'option:spec': [Function (anonymous)], 'option:tag': [Function (anonymous)], 'option:dev': [Function (anonymous)] }, _eventsCount: 20, _maxListeners: undefined, commands: [], options: [ [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option] ], parent: Command { _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, commands: [Array], options: [Array], parent: null, _allowUnknownOption: false, _args: [], rawArgs: [Array], _scriptPath: '/home/ubuntu/ROBOT/nuwave/iris-console/node_modules/.bin/cypress', _name: 'cypress', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: null, _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: undefined, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '<command> [options]', args: [Array], [Symbol(kCapture)]: false }, _allowUnknownOption: false, _args: [], rawArgs: null, _scriptPath: null, _name: 'run', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: [Function: listener], _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: 0, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '[options]', _description: 'Runs Cypress tests from the CLI without the GUI', _argsDescription: undefined, exit: true, args: [], [Symbol(kCapture)]: false } ] +1ms
  cypress:cli:cli variable-length opts parsed { args: [ '/home/ubuntu/.nvm/versions/node/v14.16.0/bin/node', '/home/ubuntu/ROBOT/nuwave/iris-console/node_modules/.bin/cypress', 'run' ], opts: Command { _events: [Object: null prototype] { 'option:browser': [Function (anonymous)], 'option:ci-build-id': [Function (anonymous)], 'option:config': [Function (anonymous)], 'option:config-file': [Function (anonymous)], 'option:env': [Function (anonymous)], 'option:group': [Function (anonymous)], 'option:key': [Function (anonymous)], 'option:headed': [Function (anonymous)], 'option:headless': [Function (anonymous)], 'option:no-exit': [Function (anonymous)], 'option:parallel': [Function (anonymous)], 'option:port': [Function (anonymous)], 'option:project': [Function (anonymous)], 'option:quiet': [Function (anonymous)], 'option:record': [Function (anonymous)], 'option:reporter': [Function (anonymous)], 'option:reporter-options': [Function (anonymous)], 'option:spec': [Function (anonymous)], 'option:tag': [Function (anonymous)], 'option:dev': [Function (anonymous)] }, _eventsCount: 20, _maxListeners: undefined, commands: [], options: [ [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option] ], parent: Command { _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, commands: [Array], options: [Array], parent: null, _allowUnknownOption: false, _args: [], rawArgs: [Array], _scriptPath: '/home/ubuntu/ROBOT/nuwave/iris-console/node_modules/.bin/cypress', _name: 'cypress', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: null, _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: undefined, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '<command> [options]', args: [Array], [Symbol(kCapture)]: false }, _allowUnknownOption: false, _args: [], rawArgs: null, _scriptPath: null, _name: 'run', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _actionHandler: [Function: listener], _executableHandler: false, _executableFile: null, _defaultCommandName: null, _exitCallback: null, _aliases: [], _hidden: false, _helpFlags: '-h, --help', _helpDescription: 'display help for command', _helpShortFlag: '-h', _helpLongFlag: '--help', _hasImplicitHelpCommand: 0, _helpCommandName: 'help', _helpCommandnameAndArgs: 'help [command]', _helpCommandDescription: 'display help for command', _usage: '[options]', _description: 'Runs Cypress tests from the CLI without the GUI', _argsDescription: undefined, exit: true, args: [], [Symbol(kCapture)]: false } } +87ms
  cypress:cli parsed cli options {} +90ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +0ms
  cypress:cli checking if executable exists /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress +5ms
  cypress:cli Binary is executable? : true +8ms
  cypress:cli binaryDir is  /home/ubuntu/.cache/Cypress/7.2.0/Cypress +0ms
  cypress:cli Reading binary package.json from: /home/ubuntu/.cache/Cypress/7.2.0/Cypress/resources/app/package.json +0ms
  cypress:cli Found binary version 7.2.0 installed in: /home/ubuntu/.cache/Cypress/7.2.0/Cypress +5ms
  cypress:cli could not read binary_state.json file at "/home/ubuntu/.cache/Cypress/7.2.0/binary_state.json" +6ms
  cypress:cli {} +0ms
  cypress:cli is Verified ? undefined +2ms
  cypress:cli running binary verification check 7.2.0 +0ms
It looks like this is your first time using Cypress: 7.2.0

  cypress:cli clearing out the verified version +2ms
  cypress:cli undefined DISPLAY environment variable +0ms
  cypress:cli Cypress will spawn its own Xvfb +0ms
  cypress:cli needs Xvfb? true +3ms
  cypress:cli Starting Xvfb +0ms
  cypress:cli disabling Electron sandbox +17ms
  cypress:cli running smoke test +0ms
  cypress:cli using Cypress executable /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress +0ms
  cypress:cli smoke test command: /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=641 +0ms
  cypress:cli smoke test timeout 30000 ms +0ms
  cypress:cli Smoke test failed: Error: Command failed with exit code 2: /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=641
/home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")")
    at makeError (/home/ubuntu/ROBOT/nuwave/iris-console/node_modules/cypress/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/ubuntu/ROBOT/nuwave/iris-console/node_modules/cypress/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  shortMessage: 'Command failed with exit code 2: /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=641',
  command: '/home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=641',
  exitCode: 2,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '/home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")")',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
} +12ms
  cypress:cli error message: /home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")") +1ms
  cypress:cli Stopping Xvfb +33ms
  ✖  Verifying Cypress can run /home/ubuntu/.cache/Cypress/7.2.0/Cypress
    → Cypress Version: 7.2.0
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------

/home/ubuntu/.cache/Cypress/7.2.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")")

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 7.2.0

Download method

  • npm (7.8.0)
  • yarn
  • Direct download
  • other

Operating System

  • Linux (Ubuntu 20.04)
  • Mac
  • Windows

Other

  • I'm installing latest Cypress version
  • I'm behind a proxy
  • This only occurs in CI
@lukebelliveau lukebelliveau added the topic: installation Issue during installation or downloading Cypress label May 6, 2021
@gitolicious
Copy link

What architecture are you running on? I stumbled upon this when trying to run Cypress on arm64. According to #4478 this is not supported for now.

My proof of (failing) concept: I modified the Cypress Ubuntu Dockerfile for Ubuntu 20.04 and NodeJS 16.

FROM ubuntu:20.04
[...]
RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
[...]

Everything works fine on amd64 (Host: Docker for Windows, Hyper-V, Win10 20H2 19042)

❯ docker build -t cypress-ubuntu -f .\Dockerfile-cypress .
❯ docker run -it --rm cypress-ubuntu
# dpkg --print-architecture
amd64
# npx -y cypress install
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
# npx cypress verify
  ✔  Verified Cypress! /root/.cache/Cypress/7.3.0/Cypress

Same commands fail on arm64 (Host: Debian 10 Buster, ODROID-N2+)

$ sudo docker build -t cypress-ubuntu -f ./Dockerfile-cypress .
$ sudo docker run -it --rm cypress-ubuntu
# dpkg --print-architecture
arm64
# npx -y cypress install
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
# npx cypress verify
  ✖  Verifying Cypress can run /root/.cache/Cypress/7.3.0/Cypress
    → Cypress Version: 7.3.0
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------

/root/.cache/Cypress/7.3.0/Cypress/Cypress: 1: Syntax error: word unexpected (expecting ")")

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 7.3.0

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period topic: installation Issue during installation or downloading Cypress
Projects
None yet
Development

No branches or pull requests

3 participants