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

[BUG] Cannot find node.js binary when debug playwright tests. #34878

Open
rupert-chen opened this issue Feb 21, 2025 · 1 comment
Open

[BUG] Cannot find node.js binary when debug playwright tests. #34878

rupert-chen opened this issue Feb 21, 2025 · 1 comment

Comments

@rupert-chen
Copy link

rupert-chen commented Feb 21, 2025

My integrated terminal profile is

"terminal.integrated.profiles.osx": {
    "zsh": {
      "path": "/usr/local/bin/zsh",
      "args": ["-l", "-i"]
    }
  }

when click debug test, an error is thrown: Cannot find node.js binary.

I see a function findNodeViaShell from the repo
when I echo $(type node 2>/dev/null) from my terminal, I see following error

ode:internal/modules/cjs/loader:1247
  throw err;
  ^

Error: Cannot find module '/Users/rupert.chen/Desktop/engage-frontend/is'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
    at Function._load (node:internal/modules/cjs/loader:1070:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
    at node:internal/main/run_main_module:36:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Look like it runs the output of type node 2>/dev/null
which is(node is /Users/rupert.chen/.nvm/versions/node/v22.13.0/bin/node)
and cause the error to load is module.

And finally result in cannot find node binary?

@Skn0tt
Copy link
Member

Skn0tt commented Feb 21, 2025

Hi Rupert. $(type node 2>/dev/null) outputs the same for me, but when I execute it inside an if, as findNodeViaShell does, everything works as expected. So I think the Cannot find module ... is error is a red herring.

I tried setting the same terminal profile as you, but also couldn't reproduce based on that. You mention "Cannot find node.js binary.", but I can't find that string inside the Playwright codebase, which makes me curious. Could you provide me with some more info on your environment? What's the specific error message that's displayed to you? Is there a stacktrace in it?

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