{"id":678,"url":"https://github.com/felixrieseberg/windows-build-tools","last_synced_at":"2025-09-27T07:31:07.380Z","repository":{"id":49276141,"uuid":"60933261","full_name":"felixrieseberg/windows-build-tools","owner":"felixrieseberg","description":":package: Install C++ Build Tools for Windows using npm","archived":true,"fork":false,"pushed_at":"2021-06-20T20:01:54.000Z","size":863,"stargazers_count":3402,"open_issues_count":86,"forks_count":237,"subscribers_count":76,"default_branch":"master","last_synced_at":"2025-01-15T05:16:39.033Z","etag":null,"topics":["build-tool","microsoft","node-gyp","nodejs","npm","python","vcc","windows"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixrieseberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-12T00:10:22.000Z","updated_at":"2025-01-10T21:13:11.000Z","dependencies_parsed_at":"2022-09-05T13:30:27.243Z","dependency_job_id":null,"html_url":"https://github.com/felixrieseberg/windows-build-tools","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixrieseberg%2Fwindows-build-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixrieseberg%2Fwindows-build-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixrieseberg%2Fwindows-build-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixrieseberg%2Fwindows-build-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixrieseberg","download_url":"https://codeload.github.com/felixrieseberg/windows-build-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410025,"owners_count":18828122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","microsoft","node-gyp","nodejs","npm","python","vcc","windows"],"created_at":"2024-01-05T20:15:28.589Z","updated_at":"2025-09-27T07:31:06.967Z","avatar_url":"https://github.com/felixrieseberg.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","JavaScript","microsoft","windows","Applications"],"sub_categories":["Development environment"],"readme":"# Windows-Build-Tools\n\n\u003ca href=\"https://ci.appveyor.com/project/felixrieseberg/windows-build-tools\"\u003e\u003cimg src=\"https://ci.appveyor.com/api/projects/status/gpna6y54wnfp07xr?svg=true\" /\u003e\u003c/a\u003e\n\u003ca href=\"http://badge.fury.io/js/windows-build-tools\"\u003e\u003cimg src=\"https://badge.fury.io/js/windows-build-tools.svg\" alt=\"npm version\" height=\"18\"\u003e\u003c/a\u003e \u003ca href=\"https://david-dm.org/felixrieseberg/windows-build-tools\"\u003e\u003cimg src=\"https://david-dm.org/felixrieseberg/windows-build-tools.svg\" alt=\"dependencies\" height=\"18px\"\u003e\u003c/a\u003e \u003cimg src=\"https://img.shields.io/npm/dm/windows-build-tools.svg\" height=\"18px\" /\u003e\n\n---\n\n\u003e Please note that the official [Node.js for Windows installer](https://nodejs.org/en/download/) can now automatically install the required tools. That's likely a much better option than the module listed here (`windows-build-tools`).\n\n---\n\nOn Windows? Want to compile [native Node modules](#examples-of-modules-supported)? Install the build tools with this one-liner. Start PowerShell as Administrator and run:\n\n```\nnpm install --global windows-build-tools\n```\n\nOr, if you are using Yarn:\n\n```\nyarn global add windows-build-tools\n```\n\n![Gif](https://user-images.githubusercontent.com/1426799/45007904-bde9f280-afb4-11e8-8a35-c77dffaffa2a.gif)\n\nAfter installation, npm will automatically execute this module, which downloads and installs Visual\nC++ Build Tools, provided free of charge for most users by Microsoft (as part of Visual Studio Community, please consult the license to determine whether or not you're eligible). These tools are [required to compile popular native modules](https://github.com/nodejs/node-gyp).\nIf not already installed, it will also install Python 3.8, configuring your machine and npm appropriately.\n\n\u003e :bulb: [Windows Vista / 7 only] requires [.NET Framework 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40773) (Currently not installed automatically by this package)\n\nBoth installations are conflict-free, meaning that they do not mess with existing installations of\nVisual Studio, C++ Build Tools, or Python. If you see anything that indicates otherwise, please\nfile a bug.\n\n## Visual Studio 2017 vs Visual Studio 2015\nThis module is capable of installing either the build tools from Visual Studio [2017](https://blogs.msdn.microsoft.com/vcblog/2016/11/16/introducing-the-visual-studio-build-tools/) or Visual\nStudio [2015](https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/).\n\nBy default, this tool will install the 2017 build tools. To change that, run this script with\nthe `--vs2015` parameter.\n\n## Usage\n\n```\nnpm [--python-mirror=''] [--proxy=''] [--debug] [--strict-ssl] [--resume] [--sockets=5] [--vcc-build-tools-parameters=''] [--vs2015] [--dry-run-only] install --global windows-build-tools\n```\n\nOptional arguments:\n\n* `--offline-installers`: Path to a folder with already downloaded installers. See\n* `--python-mirror`: Use a given mirror to download Python (like `--python_mirror=https://npm.taobao.org/mirrors/python/`). You can alternatively set a `PYTHON_MIRROR` environment variable.\n* `--proxy`: Use a given proxy. You can alternatively set a `PROXY` environment variable.\n* `--debug`: Be extra verbose in the logger output. Equal to setting the environment variable `DEBUG` to `*`.\n* `--strict-ssl`: Enables \"Strict SSL\" mode. Defaults to false.\n* `--resume`: By default, `windows-build-tools` will resume aborted downloads. Set to `false` to disable.\n* `--sockets`: Specifies the number of http sockets to use at once (this controls concurrency). Defaults to infinity.\n* `--vcc-build-tools-parameters`: Specifies additional parameters for the Visual C++ Build Tools 2015. See below for more detailed usage instructions.\n* `--silent`: The script will not output any information.\n* `--vs2015`: Install the Visual Studio 2015 Build Tools instead of the Visual Studio 2017 ones.\n* `--dry-run-only`: Don't actually do anything, just print what the script would have done.\n* `--include-arm64-tools`: Include the optional Visual Studio components required to build binaries for ARM64 Windows. Only available with the 2017 and newer build tools and Node.js v12 and up.\n\n## Supplying Parameters to the VCC Build Tools\n\nYou can pass additional parameters directly to the VCC Build Tools installer. This tool does not\ncheck if the parameters make sense - passing incorrect parameters might break the whole\ninstallation.\n\nSupply parameters to `windows-build-tools` as a JSON array. Here's quick example (note the double quotes):\n\n```\nnpm --vcc-build-tools-parameters='[\"\"--allWorkloads\"\"]' install --global windows-build-tools\n```\n\n### Visual Studio 2015 Parameters\n\nIf you run `windows-build-tools` with `--vs2015`, these parameters are available:\n\n - `/AdminFile`: \u003cfilename\u003e Specifies the installation control file.\n - `/CreateAdminFile`: \u003cfilename\u003e Specifies the location to create a control file that can then be used\n - `/CustomInstallPath`: \u003cpath\u003e Set Custom install location.\n - `/ForceRestart`: Always restart the system after installation.\n - `/Full`: Install all product features.\n - `/InstallSelectableItems`: \u003citem1;item2;...;itemN\u003e Choose which selectable item(s) to be installed.\n-selectable item to be installed, just pass in this switch without any value.\n - `/Layout`: Create a copy of the media in specified folder.\n - `/NoRefresh`: Prevent setup checking for updates from the internet.\n - `/NoRestart`: Do not restart during or after installation.\n - `/NoWeb`: Prevent setup downloading from the internet.\n - `/Passive`: Display progress but do not wait for user input.\n - `/ProductKey`: \u003c25-character product key\u003e Set custom product key (no dashes).\n - `/PromptRestart`: Prompt the user before restarting the system.\n - `/Repair`: Repair the product.\n - `/Uninstall`: Uninstall the product.\n - `/Uninstall /Force`: Uninstall the product and features shared with other products.\n\n### Visual Studio 2017 Parameters\n\nThe available parameters [are documented here](https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio).\n\n### Offline Installation\n\nBy default, `windows-build-tools` will download the latest installers from Microsoft each time\nit's installed. Alternatively, you can prepare a folder that contains installers. They need to\nhave their original names:\n\n * Visual Studio Build Tools: `vs_BuildTools.exe` or `BuildTools_Full.exe`\n * Python: `python-3.8.1.amd64.msi` or `python-3.8.1.msi`\n\nThen, run `windows-build-tools` with the `--offline-installers` argument:\n\n```ps1\nnpm install -g windows-build-tools --offline-installers=\"C:\\Users\\John\\installers\"\n```\n\n## Support \u0026 Help\n\nThis package currently only handles the most common use case, none of the edge cases. If you encounter errors, we'd greatly appreciate [error reports](https://github.com/felixrieseberg/windows-build-tools) (and even pull requests). This is currently tested on Windows 10.\n\n#### Node versions\n * `windows-build-tools` 4.0 and up require at least Node v8.\n * `windows-build-tools` 3.0 and up require at least Node v6.\n * `windows-build-tools` 1.0 and up require at least Node v4.\n\n\n#### Where is Python installed?\n\nIt's saved under `%USERPROFILE%\\.windows-build-tools\\python38`.\n\n#### Installing as a Non-Administrator\n`windows-build-tools` works best if installed from an account with administrative rights. However,\nthanks to @brucejo75, the following steps can be taken to install to a different user account:\n\n1. From your non-admin account (e.g. **\\\u003cMe\\\u003e**) run `cmd.exe` as administrator.\n2. Set the following environment variables in the new command shell:\n\n```\nset APPDATA=C:\\Users\\\u003cMe\u003e\\AppData\\Roaming\nnpm config set prefix C:\\Users\\\u003cMe\u003e\\AppData\\Roaming\\npm\nset USERNAME=\u003cMe\u003e\nset USERPROFILE=C:\\Users\\\u003cMe\u003e\n```\n\nEnsure that the variables passed match your location of npm's roaming data and the location\nof user profiles on your machine. For `\u003cme\u003e`, substitute the name of the account you want to\ninstall `windows-build-tools` for. For more information, see the `npm config set prefix`\ndescription [here](https://docs.npmjs.com/getting-started/fixing-npm-permissions).\n\n3. Run `npm install -g windows-build-tools`\n\n## Examples of Modules Supported\nIn theory, `windows-build-tools` supports all pure C++ addons for Node.js (and virtually everything\nelse that requires a native compiler toolchain to be installed on your machine).\n\nTo ensure that that's true, we take a fresh Windows 10 installation, add `windows-build-tools`, and\nensure that the most popular native Node addons compile from source. Those are: [node-sass](https://www.npmjs.com/package/node-sass), [bcrypt](https://www.npmjs.com/package/bcrypt), [sqlite3](https://www.npmjs.com/package/sqlite3), [serialport](https://www.npmjs.com/package/serialport), [websocket](https://www.npmjs.com/package/websocket), [deasync](https://www.npmjs.com/package/deasync), [grpc](https://www.npmjs.com/package/grpc), [canvas](https://www.npmjs.com/package/canvas), [sharp](https://www.npmjs.com/package/sharp),\n[hiredis](https://www.npmjs.com/package/hiredis), [leveldown](https://www.npmjs.com/package/leveldown), [nodegit](https://www.npmjs.com/package/nodegit), [zqm](https://www.npmjs.com/package/zqm), [ffi](https://www.npmjs.com/package/ffi), [libxmljs](https://www.npmjs.com/package/libxmljs), [iconv](https://www.npmjs.com/package/iconv), [ref](https://www.npmjs.com/package/ref), [sleep](https://www.npmjs.com/package/sleep), [microtime](https://www.npmjs.com/package/microtime), [couchbase](https://www.npmjs.com/package/couchbase), [bignum](https://www.npmjs.com/package/bignum),\n[kerberos](https://www.npmjs.com/package/kerberos), and [ursa](https://www.npmjs.com/package/ursa).\n\n## License \u0026 Credits\n\nThe Python installation was made possible by [Ali Hajimirza](https://github.com/ali92hm), who kindly wrestled with Python's MSIs until they surrendered. For details regarding the license agreements applicable to Python, see *History and License* [3.x](https://docs.python.org/3/license.html).\n\nUse of Microsoft software is subject to the terms of the corresponding license agreements. For details regarding the license agreements applicable to Visual Studio products, refer to their [*License Directory* page](https://visualstudio.microsoft.com/license-terms/). (See also [this discussion](https://social.msdn.microsoft.com/Forums/en-US/08d62115-0b51-484f-afda-229989be9263/license-for-visual-c-2017-build-tools?forum=visualstudiogeneral) for the gist of it.)\n\nCopyright (C) 2018 Felix Rieseberg. Licensed MIT. For more details, please see LICENSE.\nThis license applies to this package only, not to its dependencies or the 3rd party software that it installs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixrieseberg%2Fwindows-build-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixrieseberg%2Fwindows-build-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixrieseberg%2Fwindows-build-tools/lists"}