Set Visual Studio Solution version (Windows only)įorce using runtime's nfig object to generate config.gypi file
Override default CA chain (to download tarball) Set urls to ignore proxies when downloading header tarball Set HTTP(S) proxy for downloading header tarball SDK download directory (default is OS cache directory)ĭon't reinstall headers if already present Node.js version to build for (default is process.version) The value max will use all available CPU cores Node-gyp accepts the following command options: Command Removes the Node.js header files for the given version Lists the currently installed Node.js header versions Installs Node.js header files for the given version Runs clean, configure and build all in a row Generates project build files for the current platform Invokes make/ msbuild.exe and builds the native addon Node-gyp responds to the following commands: Command "binding.gyp" files out in the wild wiki page."Going Native" a nodeschool.io tutorial.Some additional resources for Node.js native addons and writing gyp configuration files: The docs directory contains additional documentation on specific node-gyp topics that may be useful if you are experiencing problems installing or building addons using node-gyp. To compile your native addon, first go to its root directory: Some old versions of Electron shipped malformed config.gypi in their headersĭistributions, and you might need to pass -force-process-config to node-gyp nfig object of the running Node.js instance. Should use -dist-url or -nodedir flags to specify the headers of theĪlso when -dist-url or -nodedir flags are passed, node-gyp will use theĬonfig.gypi shipped in the headers distribution to generate buildĬonfigurations, which is different from the default mode that would use the When building modules for thid party Node.js runtimes like Electron, which haveĭifferent build configurations from the official Node.js distribution, you If it's not a compatible version, no further Python executable, it will be used instead of any of the other configured orīuiltin Python search paths. If the NODE_GYP_FORCE_PYTHON environment variable is set to the path of a Then that version will be used, if it is a compatible version. If the PYTHON environment variable is set to the path of a Python executable, Npm config set python /path/to/executable/python by setting the -python command-line option, e.g.:.Version node-gyp should use in one of the following ways: If you have multiple Python versions installed, you can identify which Python Node-gyp requires that you have installed a compatible version of Python, one of: v3.7, v3.8,
To target native ARM64 Node.js on Windows 10 on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64".
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips. Launch cmd, npm config set msvs_version 2017.(using the "Desktop development with C++" workload) (using "Visual C++ build tools" workload) or Visual Studio Community Install Visual C++ Build Environment: Visual Studio Build Tools.Install tools and configuration manually: Install the current version of Python from the Microsoft Store package.