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

VSCode NodeJS debugger is using wrong NodeJS Version for extension debugging #18253

Closed
neutronka opened this issue Jan 7, 2017 · 4 comments
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@neutronka
Copy link

  • VSCode Version:1.8.1
  • OS Version:Windows 10 x64 and Kali Linux x64

Hey I am trying to make VSCode extension that uses nodehun module
https://www.npmjs.com/package/nodehun
which dynamically links hunspell library using node-gyp
I have on windows 10:

process.version = 7.4.0
process.arch = x64

If I try to use nodehun methods manually using NodeJS command line interface everything works fine but if I try to use it in extension.js and debug via Visual Code I have:

process.version = 6.5.0
process.arch = ia32

That makes me encounter with error

Error: %1 is not a valid win32 application.

I don't really understand how can VSCode use NodeJS version which I don't have installed.
Similarly on Kali linux x64 I have:

process.version = 7.4.0
process.arch = x64

and debugging extension via VSCode

process.version = 6.5.0
process.arch = x64

which at least have the same arch so I encounter with error

Error: Module version mismatch. Expected 50, got 51

this is really interesting because there is no node_module_version = 50, as you can see here on the nodejs website:

https://nodejs.org/en/download/releases/
there is only node_module_version 48 for versions 6.x.x and 51 for versions 7.x.x.

So I tried to rebuild with on windows 10 x64
npm rebuild --target=6.5.0 --arch=ia32 and then debug via VSCode with error

Error: A dynamic link library (DLL) initialization routine failed.

And on Kali linux x64
npm rebuild --target=6.5.0 and then debug

Error: Module version mismatch. Expected 50, got 48

I think there might be a trick in debug settings. My launch.json looks like this:

// A launch configuration that launches the extension inside a new window

{
    "version": "0.1.0",
    "configurations": [
        {
            "name": "Launch Extension",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutable": "${execPath}",
            "args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
            "stopOnEntry": false
        },
        {
            "name": "Launch Tests",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutable": "${execPath}",
            "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ],
            "stopOnEntry": false
        }
    ]
}

How is it possible that VSCode debugger have different NodeJS version that I have installed and using node_module_version = 50?
Any suggestions or workaround how could I make it work?

@neutronka
Copy link
Author

VScode comes with node,node2 and extensionHost debug configuration
If I type in console debug for node and node2:
process.version
and
process.arch
I get right result with corresponds with my nodejs version(7.4.0). but if the configuration type is
"type": "extensionHost", I get wrong version 6.5.0 on both Windows and Linux

@weinand
Copy link
Contributor

weinand commented Jan 9, 2017

@neutronka VS Code runs extensions on the node version that is built into electron (on which VS Code is based). This cannot be changed.

@weinand weinand closed this as completed Jan 9, 2017
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jan 9, 2017
@neutronka
Copy link
Author

@weinand sorry but this still doesnt explain why it uses nodejs version with node_module_version=50 which doesnt exists according to https://nodejs.org/en/download/releases/
Hence I am not able to build modules for this version. 6.5.0 shows module_version=48 and if I build for this version I am getting: Module version missmatch. Expected 50. Got 48. As stated above

@weinand
Copy link
Contributor

weinand commented Jan 9, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

2 participants