I cannot open cypress even with the extention

Hello,

I tried to install cypress, so I created a Node repl, I installed the cypress extention.

After that, I go on the shell, I entered : cypress open, I get :


You can see the package on the left, cypress is installed, but in shell it’s not, so I installed it in cmd line :

~/Node-cypress$ cypress install
Installing Cypress (version: 12.12.0)

✔  Downloaded Cypress
✔  Unzipped Cypress
✔  Finished Installation /home/runner/.cache/Cypress/12.12.0

You can now open Cypress by running: node_modules/.bin/cypress open

https://on.cypress.io/installing-cypress

I ran again the cypress open, and I get an error :

~/Node-cypress$ cypress open
It looks like this is your first time using Cypress: 12.12.0


Cypress failed to start.

This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies

Please refer to the error below for more details.

----------

/home/runner/.cache/Cypress/12.12.0/Cypress/Cypress: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

----------

Platform: linux-x64 (Ubuntu - 20.04)
Cypress Version: 12.12.0

Never mind, I know this dependencies from : Cypress doc

So I executed it and got :

~/Node-cypress$ apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

What am I doing wrong?

Thanks

1 Like

I tried to run the apt-get in sudo, I got the error :
sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag

1 Like

Try seeing if you can find the lib (shared file) it’s complaining about on nix, and then add it to the replit.nix file.

2 Likes

There isn’t root access on Replit without proot, so you can’t install packages. Try doing what @Firepup650 said, install thru nix.

2 Likes

Yeah, apt isn’t a thing on Replit. You gotta use Nix.

2 Likes

Thanks for your answers, I checked libgobject-2.0.so.0 in the NixOs search
But I did not find any lib about this one.

1 Like

Don’t search the entire thing, just try searching libgobject or maybe just run

$ nix-env -iA nixpkgs.libgobject
1 Like

Thanks,

I tried libgobject in the nixOs Search but it’s returning
No packages found!

I tried your :

$ nix-env -iA nixpkgs.libgobject

But I got :

error: attribute 'libgobject' in selection path 'nixpkgs.libgobject' not found
1 Like

Okay. That isn’t working… I am going to try to find the .so file manually, and then we will have to add it to your $LD_LIBRARY_PATH variable for it to render. I’ll edit this when I find it…
Edit 1: Try installing glib instead of libgobject.

3 Likes

[quote=“pxlmastrXD, post:9, topic:34124”]
Thanks !

I tried to install glib like :

~/Cypress$ nix-env -iA nixpkgs.glib
installing 'glib-2.68.3'
building '/nix/store/ka882zv7541rkd8g2cqq0a97lxwapyvp-user-environment.drv'...
created 22 symlinks in user environment

Then run again cypress :

~/Cypress$ cypress open
It looks like this is your first time using Cypress: 12.13.0


Cypress failed to start.

This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies

Please refer to the error below for more details.

----------

/home/runner/.cache/Cypress/12.13.0/Cypress/Cypress: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

----------

Platform: linux-x64 (Ubuntu - 20.04)
Cypress Version: 12.13.0

You spoke about:

$LD_LIBRARY_PATH variable for it to render

I’ll take a look in the doc if I find how to do it and I’ll update if I find something.

Thanks for your help, I appreciate !

EDIT: I always tried to run cypress in shell with the cmd line cypress open because cypress created automatically the folders as first try BUT I installed cypress like :
https://search.nixos.org/packages?channel=22.11&show=cypress&from=0&size=50&sort=relevance&type=packages&query=cypress

But it’s not the Version: 10.10.0
It’s the version 8.3.0 which is installed…
Cypress is on version 12+++ now !

AND I didn’t find the way to run it in shell : I click on the run button with :
run = "CYPRESS_INSTALL_BINARY=0 CYPRESS_RUN_BINARY=$(which Cypress) npx cypress run --browser chromium"

In the .replit file

If someone know why I cannot run cypress open in shell ? and why it’s not the cypress latest version on NixOs package :slight_smile:

Thanks for your help !

2 Likes