napajs icon indicating copy to clipboard operation
napajs copied to clipboard

Napa.js Configuration for Visual Studio Code Extensions

Open ricardoferreirasilva opened this issue 7 years ago • 3 comments

Greetings,

I am currently developing an extension for visual studio code and would like to take advantage of napajs in order to do some heavy processing. I tried following standard installation but I got this error:

Error: Module did not self-register. at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20) at Object.Module._extensions..node (module.js:598:18) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\Ricardo da Silva\Documents\Ludus\AgeVSCode\age-languageServer\client\server\node_modules\napajs\lib\binding.js:24:22) at Object.<anonymous> (c:\Users\Ricardo da Silva\Documents\Ludus\AgeVSCode\age-languageServer\client\server\node_modules\napajs\lib\binding.js:29:3)

I assume this has something to do with the fact that Visual Studio Code runs over Electron. I wonder if there are any plans to add VSCODE as a pre-configured enviroment or if someone has sucessfully managed to make a configuration to make it run.

ricardoferreirasilva avatar Jun 18 '18 15:06 ricardoferreirasilva

greetings @tansvanio could you please let me know the node version and napa version that you are using?

fs-eire avatar Jun 18 '18 16:06 fs-eire

@fs-eire Node version: v8.11.3 Napa version: 0.2.3

ricardoferreirasilva avatar Jun 18 '18 16:06 ricardoferreirasilva

I haven't developed vscode extension before. I guess this error is because of node module version. Basicly Node requires an addon to be built upon the same NODE_MODULE_VERSION. Electron uses a unique NODE_MODULE_VERSION so a rebuild is required (see https://github.com/Microsoft/napajs/wiki/Build-Napa.js-for-Electron)

fs-eire avatar Jun 18 '18 17:06 fs-eire