windows-build-tools

📦 Install C++ Build Tools for Windows using npm
授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 刘弘新
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Windows-Build-Tools


Please note that the official Node.js for Windows installer can now automatically install the required tools. That's likely a much better option than the module listed here (windows-build-tools).


On Windows? Want to compile native Node modules? Install the build tools with this one-liner. Start PowerShell as Administrator and run:

npm install --global windows-build-tools

Or, if you are using Yarn:

yarn global add windows-build-tools

Gif

After installation, npm will automatically execute this module, which downloads and installs VisualC++ 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.If not already installed, it will also install Python 3.8, configuring your machine and npm appropriately.

�� [Windows Vista / 7 only] requires .NET Framework 4.5.1 (Currently not installed automatically by this package)

Both installations are conflict-free, meaning that they do not mess with existing installations ofVisual Studio, C++ Build Tools, or Python. If you see anything that indicates otherwise, pleasefile a bug.

Visual Studio 2017 vs Visual Studio 2015

This module is capable of installing either the build tools from Visual Studio 2017 or VisualStudio 2015.

By default, this tool will install the 2017 build tools. To change that, run this script withthe --vs2015 parameter.

Usage

npm [--python-mirror=''] [--proxy=''] [--debug] [--strict-ssl] [--resume] [--sockets=5] [--vcc-build-tools-parameters=''] [--vs2015] [--dry-run-only] install --global windows-build-tools

Optional arguments:

  • --offline-installers: Path to a folder with already downloaded installers. See
  • --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.
  • --proxy: Use a given proxy. You can alternatively set a PROXY environment variable.
  • --debug: Be extra verbose in the logger output. Equal to setting the environment variable DEBUG to *.
  • --strict-ssl: Enables "Strict SSL" mode. Defaults to false.
  • --resume: By default, windows-build-tools will resume aborted downloads. Set to false to disable.
  • --sockets: Specifies the number of http sockets to use at once (this controls concurrency). Defaults to infinity.
  • --vcc-build-tools-parameters: Specifies additional parameters for the Visual C++ Build Tools 2015. See below for more detailed usage instructions.
  • --silent: The script will not output any information.
  • --vs2015: Install the Visual Studio 2015 Build Tools instead of the Visual Studio 2017 ones.
  • --dry-run-only: Don't actually do anything, just print what the script would have done.
  • --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.

Supplying Parameters to the VCC Build Tools

You can pass additional parameters directly to the VCC Build Tools installer. This tool does notcheck if the parameters make sense - passing incorrect parameters might break the wholeinstallation.

Supply parameters to windows-build-tools as a JSON array. Here's quick example (note the double quotes):

npm --vcc-build-tools-parameters='[""--allWorkloads""]' install --global windows-build-tools

Visual Studio 2015 Parameters

If you run windows-build-tools with --vs2015, these parameters are available:

  • /AdminFile: Specifies the installation control file.
  • /CreateAdminFile: Specifies the location to create a control file that can then be used
  • /CustomInstallPath: Set Custom install location.
  • /ForceRestart: Always restart the system after installation.
  • /Full: Install all product features.
  • /InstallSelectableItems: <item1;item2;...;itemN> Choose which selectable item(s) to be installed.-selectable item to be installed, just pass in this switch without any value.
  • /Layout: Create a copy of the media in specified folder.
  • /NoRefresh: Prevent setup checking for updates from the internet.
  • /NoRestart: Do not restart during or after installation.
  • /NoWeb: Prevent setup downloading from the internet.
  • /Passive: Display progress but do not wait for user input.
  • /ProductKey: <25-character product key> Set custom product key (no dashes).
  • /PromptRestart: Prompt the user before restarting the system.
  • /Repair: Repair the product.
  • /Uninstall: Uninstall the product.
  • /Uninstall /Force: Uninstall the product and features shared with other products.

Visual Studio 2017 Parameters

The available parameters are documented here.

Offline Installation

By default, windows-build-tools will download the latest installers from Microsoft each timeit's installed. Alternatively, you can prepare a folder that contains installers. They need tohave their original names:

  • Visual Studio Build Tools: vs_BuildTools.exe or BuildTools_Full.exe
  • Python: python-3.8.1.amd64.msi or python-3.8.1.msi

Then, run windows-build-tools with the --offline-installers argument:

npm install -g windows-build-tools --offline-installers="C:\Users\John\installers"

Support & Help

This package currently only handles the most common use case, none of the edge cases. If you encounter errors, we'd greatly appreciate error reports (and even pull requests). This is currently tested on Windows 10.

Node versions

  • windows-build-tools 4.0 and up require at least Node v8.
  • windows-build-tools 3.0 and up require at least Node v6.
  • windows-build-tools 1.0 and up require at least Node v4.

Where is Python installed?

It's saved under %USERPROFILE%\.windows-build-tools\python38.

Installing as a Non-Administrator

windows-build-tools works best if installed from an account with administrative rights. However,thanks to @brucejo75, the following steps can be taken to install to a different user account:

  1. From your non-admin account (e.g. <Me>) run cmd.exe as administrator.
  2. Set the following environment variables in the new command shell:
set APPDATA=C:\Users\<Me>\AppData\Roaming
npm config set prefix C:\Users\<Me>\AppData\Roaming\npm
set USERNAME=<Me>
set USERPROFILE=C:\Users\<Me>

Ensure that the variables passed match your location of npm's roaming data and the locationof user profiles on your machine. For <me>, substitute the name of the account you want toinstall windows-build-tools for. For more information, see the npm config set prefixdescription here.

  1. Run npm install -g windows-build-tools

Examples of Modules Supported

In theory, windows-build-tools supports all pure C++ addons for Node.js (and virtually everythingelse that requires a native compiler toolchain to be installed on your machine).

To ensure that that's true, we take a fresh Windows 10 installation, add windows-build-tools, andensure that the most popular native Node addons compile from source. Those are: node-sass, bcrypt, sqlite3, serialport, websocket, deasync, grpc, canvas, sharp,hiredis, leveldown, nodegit, zqm, ffi, libxmljs, iconv, ref, sleep, microtime, couchbase, bignum,kerberos, and ursa.

License & Credits

The Python installation was made possible by Ali Hajimirza, 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.

Use 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. (See also this discussion for the gist of it.)

Copyright (C) 2018 Felix Rieseberg. Licensed MIT. For more details, please see LICENSE.This license applies to this package only, not to its dependencies or the 3rd party software that it installs.

  • 转载 本文为CSDN博主「FencingMan-X」的原创文章https://blog.csdn.net/oqzuser1234asd/article/details/116169889 解决npm安装windows-build-tools时卡在Successfully installed Python 2.7 如果你找到了这里,说明你之前看过的博文都是没有效果且没有任何意义的。因为我按照其他的教

  • npm install --global --production windows-build-tools --vs2015

  • npm i -g windows-build-tools安装出错解决方法 参考文章: (1)npm i -g windows-build-tools安装出错解决方法 (2)https://www.cnblogs.com/heamin/p/10887437.html 备忘一下。

  • build tools是一个把源代码生成可执行应用程序的过程自动化的程序。构建包括编译、连接跟把代码打包成可用的或可执行的形式。 在小型项目中,开发者往往手动调用构建过程,这样在大型的项目中很不实用,在构建过程中难以跟踪什么需要被构建、按照什么顺序构建以及项目中存在哪些依赖。使用自动化工具会使构建过程更为连续。 提供各种构建工具(仅命名少数): 1.对于java - Ant,Maven,Gradl

 相关资料
  • IntelliJ提供了一种构建和打包Java包的方法。 它支持Maven和Gradle等外部构建工具。 本章讨论这些构建工具。 创建Maven项目 按照以下步骤创建Maven项目 - 导航到File → Project 。 选择Maven选项,然后单击Next按钮。 在新项目窗口中,将wenjiangs.com作为GroupId输入,将HelloWorld输入为ArtifactId。 在New窗口

  • Windows Phone Power Tools将使得开发者在开发应用程序时更加简单,提供了一些windows phone SDK开发工具不支持的功能。这个开发工具是根据开发者实际需求推出的开源的开发工具: Windows Phone Power Tools是Windows phone SDK开发工具的一个扩展,在测试更新时,允许开发者直接更新已经开发完成的应用,而不需要重新安装xaps。同时,

  • 我已经在这个问题上挣扎了几天,我似乎找不到解决它的方法,以下是完整的错误: 以下是我的评分。构建内容: 我还将自己的gradle.build文件添加到plugin/Android中,该文件是相同的,但不同的BuildToolsVersion设置为27.0.0,但是,位于项目中Temp文件夹中的build.gradle文件仍然将自己重置为“28”, 更新:从构建工具中删除28.0.0-rc1后,bu

  • 问题内容: 我正在尝试在Jenkins上使用Android模拟器来构建和测试我的项目。但是运行gradle任务时出现以下错误; 找不到构建工具版本17.0.0 我正在运行的gradle任务是; 在我的gradle构建文件中,我具有以下配置 构建服务器是一个无头的Ubuntu实例(大约12个实例)。我的第一个想法是我没有安装正确的构建工具,因此我去看了android-sdk / build- too

  • 嗨,我正面临构建版本的问题。当我运行该应用程序时,它会抛出一个错误,

  • 我经常在使用库时犯这个错误...