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

Node version does not exist in Cypress #21

Closed
TrevinAvery opened this issue Oct 30, 2023 · 2 comments
Closed

Node version does not exist in Cypress #21

TrevinAvery opened this issue Oct 30, 2023 · 2 comments

Comments

@TrevinAvery
Copy link

I am using this package within a Cypress test. In the latest version, this line fails

if (Number(process.versions.node.split('.')[0]) >= 16) {

with

TypeError: Cannot read properties of undefined (reading 'split')

This is because process.versions.node is undefined in Cypress (even though it uses node). I'm not certain why it is undefined, but it would be ideal to change this line to account for this situation.

@sindresorhus
Copy link
Owner

You need to open an issue on Cypress about that. This is a Node.js module and it expects Node.js APIs to be fully available.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2023
@TrevinAvery
Copy link
Author

I'm curious what node APIs this depends on. I've been using version 5.1.0 in Cypress for over a year, and it has worked just fine. It was only when I updated to 6.0.1 that I started seeing this problem.

Is it possible to make this work without node so it can run on frontend applications?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants