Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
node-pre-gyp",id:"modules-that-rely-on-node-pre-gyp",children:[]}],d={rightToc:l};function s(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(o.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)("p",null,"Native Node modules are supported by NodeGui, but since NodeGui is very\nlikely to use a different V8 version from the Node binary installed on your\nsystem, the modules you use will need to be recompiled for NodeGui's node/v8 version. Otherwise,\nyou will get the following class of error when you try to run your app:"),Object(i.b)("pre",null,Object(i.b)("code",Object(o.a)({parentName:"pre"},{className:"language-sh"}),"Error: The module '/path/to/native/module.node'\nwas compiled against a different Node.js version using\nNODE_MODULE_VERSION $XYZ. This version of Node.js requires\nNODE_MODULE_VERSION $ABC. Please try re-compiling or re-installing\nthe module (for instance, using `npm rebuild` or `npm install`).\n")),Object(i.b)("h2",{id:"how-to-install-native-modules"},"How to install native modules"),Object(i.b)("p",null,"To compile native Node modules against a build of NodeGui that doesn't\nmatch a public release, instruct ",Object(i.b)("inlineCode",{parentName:"p"},"npm")," to use the version of Qode (NodeJs) you have bundled\nwith your custom build."),Object(i.b)("pre",null,Object(i.b)("code",Object(o.a)({parentName:"pre"},{className:"language-sh"}),"npm rebuild --nodedir=/path/to/nodegui/vendor/qode\n")),Object(i.b)("p",null,"or"),Object(i.b)("pre",null,Object(i.b)("code",Object(o.a)({parentName:"pre"},{className:"language-sh"}),"qode /path/to/npm rebuild\n")),Object(i.b)("h2",{id:"troubleshooting"},"Troubleshooting"),Object(i.b)("p",null,"If you installed a native module and found it was not working, you need to check\nthe following things:"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"When in doubt, rebuild native modules with qode first."),Object(i.b)("li",{parentName:"ul"},"Make sure the native module is compatible with the target platform and\narchitecture for your NodeGui app."),Object(i.b)("li",{parentName:"ul"},"After you upgrade NodeGui, you usually need to rebuild the modules.")),Object(i.b)("h2",{id:"modules-that-rely-on-node-pre-gyp"},"Modules that rely on ",Object(i.b)("inlineCode",{parentName:"h2"},"node-pre-gyp")),Object(i.b)("p",null,"The ",Object(i.b)("a",Object(o.a)({parentName:"p"},{href:"https://github.com/mapbox/node-pre-gyp"}),Object(i.b)("inlineCode",{parentName:"a"},"node-pre-gyp")," tool")," provides a way to deploy native Node\nmodules with prebuilt binaries, and many popular modules are using it."),Object(i.b)("p",null,"Usually those modules work fine under NodeGui, but sometimes when NodeGui uses\na newer version of V8 than Node and/or there are ABI changes, bad things may\nhappen. So in general, it is recommended to always build native modules from\nsource code."))}s.isMDXComponent=!0},465:function(e,n,t){"use strict";t.d(n,"a",(function(){return c})),t.d(n,"b",(function(){return m}));var o=t(0),r=t.n(o);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function u(e){for(var n=1;nWe could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.