中央处理器
| 英特尔®酷睿TM i7-8650U CPU @ 1.90GHz(8 x 816)
-| --
GPU状态
| 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
负载(平均)| 1 1 1
内存(系统)| 15.42GB(免费4.06GB)
工艺Argv | --disable-gpu
屏幕阅读器| 不
虚拟机| 0%
版本:1.29.1
提交:bc24f98b5f70467bc689abf41cc5550ca637088e
日期:2018-11-15T19:07:43.495Z
电子:2.0.12
铬:61.0.3163.100
Node.js:8.9.3
V8:6.1.534.41
架构:x64
重现步骤:
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/build/index.js",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
"${workspaceFolder}/build/**/*.js"
]
}
]
}
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`).
我尝试过
rm -rf node_modules
然后是npm install
nvm use
具有各种版本(package.json列出"node": "10.13.0",
)npm rebuild
在vscode调试器之外构建和提供应用程序时,不会发生该错误-该错误是调试器所独有的。
禁用所有扩展后是否会发生此问题?:是
@ komali2
您的默认node.js版本是什么?
在VS Code外部和VS Code的集成终端中运行node --version
。
在两种情况下,您都看到相同的版本吗?
如果您使用的是“ nvm”或“ nvs”,则可以在启动配置中添加"runtimeVersion": "x.y.z"
,以使VS Code使用特定版本的node.js。
哦,我知道了,我还没考虑过。
集成的VSCode终端内部的npm version
是10.13.0
,而我实际的终端内部是8.1...
东西。 因此,我在vscode之外
nvm use 10.13.0
npm rebuild
然后,我尝试在vscode中使用调试器,但是,仍然出现以下错误:
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
既然我看到终端版本有所不同,这可能不是VSCODE错误。 无论如何,谢谢您的帮助。 我有点困惑...我不知道要针对NODE_MODULE_VERSION 64
或57
映射哪个版本的节点,我从来没有见过这样提到过...
如果使用nvm,则必须确保VS Code选择了nvm的节点版本(这并不像看起来那样简单,因为nvm对此不使用环境变量,而使用shell函数;请参见https:// stackoverflow .com / questions / 44700432 / visual-studio-code-to-use-node-version-specified-by-nvm)。
更明确的方法(因此建议使用)是在启动配置中添加"runtimeVersion": "8.1.0"
。
我不是不知道npm rebuild
是否足以针对另一版本的节点重建本机模块。