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

Debugger crashing - "Error: The module '/bcrypt_lib.node' was compiled against a different Node.js version..." #64921

Closed
komali2 opened this issue Dec 12, 2018 · 3 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@komali2
Copy link

komali2 commented Dec 12, 2018

CPUs

| Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 816)
-- | --

GPU Status

| 2d_canvas: unavailable_softwarechecker_imaging: disabled_offflash_3d: unavailable_softwareflash_stage3d: unavailable_softwareflash_stage3d_baseline: unavailable_softwaregpu_compositing: unavailable_softwaremultiple_raster_threads: enabled_onnative_gpu_memory_buffers: disabled_softwarerasterization: unavailable_softwarevideo_decode: unavailable_softwarevideo_encode: unavailable_softwarewebgl: enabled_readbackwebgl2: unavailable_off

Load (avg) | 1, 1, 1

Memory (System) | 15.42GB (4.06GB free)

Process Argv | --disable-gpu

Screen Reader | no

VM | 0%

Version: 1.29.1
Commit: bc24f98
Date: 2018-11-15T19:07:43.495Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Steps to Reproduce:

  1. Have a node server using the module bcrypt
  2. Try to user the debugger with the following settings;

    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceFolder}/build/index.js",
            "preLaunchTask": "tsc: build - tsconfig.json",
            "outFiles": [
                "${workspaceFolder}/build/**/*.js"
            ]
        }
    ]
}
  1. Note the following error:
module.js:682
  return process.dlopen(module, path._makeLong(filename));
                 ^
Error: The module '/home/calebjay/Documents/work/internal-admin/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

I have attempted

  1. rm -rf node_modules followed by npm install
  2. nvm use with various versions (the package.json lists "node": "10.13.0",)
  3. npm rebuild

The error does not occur when the app is built and served outside of the vscode debugger - the error is unique to the debugger.

Does this issue occur when all extensions are disabled?: Yes

@isidorn isidorn assigned roblourens and weinand and unassigned isidorn Dec 13, 2018
@weinand
Copy link
Contributor

weinand commented Dec 13, 2018

@komali2
What is your default node.js version?
run node --version outside of VS Code and inside VS Code's integrated terminal.
Do you see the same version in both cases?

If you are using "nvm" or "nvs" you can add a "runtimeVersion": "x.y.z" to your launch config to make VS Code use a specific version of node.js.

@weinand weinand added info-needed Issue requires more information from poster debug Debug viewlet, configurations, breakpoints, adapter issues labels Dec 13, 2018
@komali2
Copy link
Author

komali2 commented Dec 13, 2018

Oh I see, I hadn't considered that.

npm version inside the integrated VSCode terminal is 10.13.0, and inside my actual terminal was 8.1... something. So, outside vscode I did

nvm use 10.13.0

npm rebuild

Then, I tried inside vscode to use the debugger, however, I'm still getting the following error:

was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing

This probably isn't a VSCODE bug, now that I see there's a difference in the terminal versions. Thank you anyway for your help. I'm a bit confused... I've no idea what versions of node to map against NODE_MODULE_VERSION 64 or 57, I've never seen them referred to that way...

@weinand
Copy link
Contributor

weinand commented Dec 13, 2018

If you use nvm, you will have to make sure that VS Code picks up nvm's node version (this is not as simple as it seems because nvm does not use an environment variable for this but a shell function instead; see https://stackoverflow.com/questions/44700432/visual-studio-code-to-use-node-version-specified-by-nvm).

A more explicit (and therefore my recommended) approach is to use add a "runtimeVersion": "8.1.0"to the launch config.


I don't no whether a npm rebuildis sufficient to rebuild a native module against another version of node.

@weinand weinand removed the info-needed Issue requires more information from poster label Dec 13, 2018
@weinand weinand closed this as completed Dec 13, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 27, 2019
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

4 participants