'npm: run cypress UI for remote project

The application with cypress tests and npm package files is located on a remote server. I am trying to run cypress UI on local machine for that project. Both machines are on same network, remote is connectable with ssh.

Passing remote dir --prexif

npm --prefix [email protected]/~/test_dir \ 
# test_dir contains package.json, package-lock.json, cypress/integration/, cypress/support/ 
run cy:open -- \
--config [email protected]/~/test_dir

results in:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/kristupas/[email protected]/~/test_dir/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/kristupas/[email protected]/~/test_dir/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kristupas/.npm/_logs/2022-04-21T08_26_27_666Z-debug.log


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source