DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.78k stars 661 forks source link

Testcafe 3.6.0 not compatible with Node 14 #8191

Closed nermin99 closed 1 month ago

nermin99 commented 1 month ago

What is your Scenario?

I'm in a project where we're restricted to using Node 14.15.4. I tried installing Testcafe 3.6.0 but when running testcafe locally I get Error: Cannot find module 'node:path' with code: 'MODULE_NOT_FOUND'

What is the Current behavior?

Testcafe 3.6.0 not working with Node 14

What is the Expected behavior?

Testcafe 3.6.0 should work with Node 14

What is the public URL of the test page? (attach your complete example)

https://google.com

What is your TestCafe test code?

package.json:

{ 
  "scripts": {
    "test": "testcafe",
  },
  "dependencies": {
    "testcafe": "^3.6.0",
  }
}

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

1. 2. 3.

TestCafe version

3.6.0

Node.js version

14.15.4

Command-line arguments

npm run test

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

Error: Cannot find module 'node:path'
Require stack:
- C:\Users\myuser\testcafe-test\node_modules\path-scurry\dist\commonjs\index.js
- C:\Users\myuser\testcafe-test\node_modules\glob\dist\cjs\glob.js
- C:\Users\myuser\testcafe-test\node_modules\glob\dist\cjs\index.js
- C:\Users\myuser\testcafe-test\node_modules\glob\dist\cjs\index-cjs.js
- C:\Users\myuser\testcafe-test\node_modules\babel-plugin-module-resolver\lib\normalizeOptions.js
- C:\Users\myuser\testcafe-test\node_modules\babel-plugin-module-resolver\lib\index.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\compiler\babel\load-libs.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\compiler\compile-client-function.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\client-functions\replicator.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\client-functions\client-function-builder.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\api\skip-js-errors\index.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\utils\get-options\skip-js-errors.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\utils\get-options\index.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\cli\argument-parser\index.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\cli\cli.js
- C:\Users\myuser\testcafe-test\node_modules\testcafe\lib\cli\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\myuser\testcafe-test\node_modules\path-scurry\dist\commonjs\index.js:28:21) 
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\path-scurry\\dist\\commonjs\\index.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\glob\\dist\\cjs\\glob.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\glob\\dist\\cjs\\index.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\glob\\dist\\cjs\\index-cjs.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\babel-plugin-module-resolver\\lib\\normalizeOptions.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\babel-plugin-module-resolver\\lib\\index.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\compiler\\babel\\load-libs.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\compiler\\compile-client-function.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\client-functions\\replicator.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\client-functions\\client-function-builder.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\api\\skip-js-errors\\index.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\utils\\get-options\\skip-js-errors.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\utils\\get-options\\index.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\cli\\argument-parser\\index.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\cli\\cli.js',
    'C:\\Users\\myuser\\testcafe-test\\node_modules\\testcafe\\lib\\cli\\index.js'
  ]
}
nermin99 commented 1 month ago

I found out that Testcafe 3.6.0 uses a dependency that in turn uses node:path which was introduced in Node 16