Native node modules from extensions
See original GitHub issueI’m looking to build an extension but one of the packages I need to depend on is a native module. When I do an npm install it installs the package just fine, I can launch a node shell and interact with it, etc. But when I go to use the package from within my plugin I get an error as it’s trying to load the ia32 build of the native module not the x64 which was compiled by node-gyp.
A quick bit of debugging indicates that the problem stems by process.arch returning ia32 when running in VS Code when my machine is a x64 machine (Win10 x64).
So is there some way to either:
- Have VS Code run an x64 process
- Have VS Code’s ia32 process do my npm restore (and subsequent compile with node-gyp)
Otherwise I fear that my extension might be dead in the water 😦
Issue Analytics
- State:
- Created 8 years ago
- Reactions:41
- Comments:42 (12 by maintainers)
Top Results From Across the Web
Writing Native Node.js Modules - RisingStack Engineering
The knowledge on native modulesXNative modules in NodeJS context are modules that are written in C/C++ to interact with lower level functions/ ...
Read more >Native Extensions for Node.js - Medium
This Node.js module provides us with a C++ implementation of N-API and allows us to use the language advantages. FIRST STEPS IN THE...
Read more >Native Node Modules | Electron
Modules that rely on node-pre-gyp The node-pre-gyp tool provides a way to deploy native Node modules with prebuilt binaries, and many popular...
Read more >How to run vscode extension which depends on native module
Delete node-module folder and package-lock.json · install electron using npm: npm install --save-dev electron · Install electron rebuild: npm ...
Read more >How to build your own Native Node Module - IBM MediaCenter
Native Node Modules are the perfect tool for Node.js applications that need to run performance critical code, access system level APIs, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The Extension Publishing section of Roadmap 2019 includes:
would this address this issue?
While I can’t promise adding any support to make it easier to use native modules, we can add some documentations for the current state: https://github.com/Microsoft/vscode-docs/issues/2211