GithubHelp home page GithubHelp logo

felixrieseberg / windows-build-tools Goto Github PK

View Code? Open in Web Editor NEW
3.4K 76.0 233.0 863 KB

:package: Install C++ Build Tools for Windows using npm

License: MIT License

PowerShell 7.02% JavaScript 3.93% TypeScript 89.05%
npm windows node-gyp nodejs build-tool vcc microsoft python

windows-build-tools's Introduction

Windows-Build-Tools

npm version dependencies


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 Visual C++ 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 of Visual Studio, C++ Build Tools, or Python. If you see anything that indicates otherwise, please file a bug.

Visual Studio 2017 vs Visual Studio 2015

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

By default, this tool will install the 2017 build tools. To change that, run this script with the --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 not check if the parameters make sense - passing incorrect parameters might break the whole installation.

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 time it's installed. Alternatively, you can prepare a folder that contains installers. They need to have 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 location of user profiles on your machine. For <me>, substitute the name of the account you want to install windows-build-tools for. For more information, see the npm config set prefix description 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 everything else 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, and ensure 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.

windows-build-tools's People

Contributors

bzoz avatar cclauss avatar dependabot[bot] avatar dr3x avatar felixrieseberg avatar gucong3000 avatar insin avatar jacobq avatar jagdeepjain avatar jkunkee avatar joaocgreis avatar jvmahon avatar kittaakos avatar massimocode avatar mikeharder avatar mikemaccana avatar nick-pape avatar pronebird avatar sadegroot avatar shahidcodes avatar vladfrangu avatar voltagex avatar xiekun1992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-build-tools's Issues

Can't find Python executable "python" after installing

node-gyp is failing because it can't find python. windows-build-tools did its thing and python is installed:

$ $(npm config get python)
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
$ npm --version
4.5.0
$ node --version
v7.9.0

Here's the output from node-gyp:

+ node_modules/.bin/electron-rebuild --arch x64 -f -p -w serialport -m electron-app
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\mike\Work\dronefuse-client\node_modules\node-gyp\lib\configure.js:482:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\mike\Work\dronefuse-client\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\mike\Work\dronefuse-client\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:114:15)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mike\\Work\\dronefuse-client\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=1.4.13" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=serialport" "--module_path=C:\\Users\\mike\\Work\\dronefuse-client\\electron-app\\node_modules\\serialport\\build\\Release" "--host=https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7"
gyp ERR! cwd C:\Users\mike\Work\dronefuse-client\electron-app\node_modules\serialport
gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok

Estimated Size

Is there any estimated size for installing the contents? I have previously installed them a few times, manually, and then the size seemed to be between 4 and 6 GB. For many systems it is not an issue, but for smaller ones constrained by available space it is.

The term 'python' is not recognized

After successfully installing windows-build-tools, my node-gyp installations are still failing with the following error:

gyp ERR! stack Error: Can't find Python executable "C:\Users\Development\.windows-build-tools\python27", you can set the PYTHON env variable.

I manually added the .windows-build-tools directory to my user's environment variables as PYTHON, and $env:PYTHON resolves appropriately.

Yes, I did try restarting my box.

Am I missing something? Should I have done something differently? Is this a bug?

How to install optional library ATL?

Hello! 👋

I see that ATL is listed as an optional library, but I'm unsure what command line switches to use to install it. I cannot find documentation for what item names /InstallSelectableItems accepts, and even /Full doesn't seem to install ATL.

Any guidance would be appreciated. 👌

Thanks!

Remove build tools completely.

Hey guys I accidently installed windows built tools using a 32bit nodejs msi. How do I uninstall everything and install with a 64bit installer. Everytime I build it says it is not a win32 app because I have to use node 64 for the package I'm using. Thanks!

installation fails because of gc'ed promise

I am known to be not quite the promise friend. But this broke quickly and I think due to the limited amount of callbacks here, simple callback style would have been better. :-(

For reference:

<--- Last few GCs --->

  105216 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 2086.4 / 0 ms [allocation failure] [GC in old space requested].
  107011 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 1795.2 / 0 ms [allocation failure] [GC in old space requested].
  108885 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 1874.4 / 0 ms [last resort gc].
  110850 ms: Mark-sweep 1380.9 (1435.0) -> 1380.9 (1435.0) MB, 1964.9 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 00000085C96C9E79 <JS Object>
    1: /* anonymous */(aka /* anonymous */) [native promise.js:26] [pc=000001B1CEAEE394] (this=00000085C9604189 <undefined>,value=000001DCE369B511 <a Promise with map 00000175A449FF99>)
    2: /* anonymous */(aka /* anonymous */) [C:\Program Files (x86)\Nodist\bin\node_modules\windows-build-tools\lib\install\tailer.js:136] [pc=000001B1CEC32439] (this=00000085C9604101 <null>,err=000001DCE369B3...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\node.exe" "C:\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node ./lib/index.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\jefe-win\npm-debug.log

Set environment vars per package

Hi

So following #12 I noticed (from the Task Manager) that the build tools were installing. I let these install and also installed python manually from the version that was downloaded by running this tool.

However, I still can't install [email protected]. I get the following error:
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".

Any ideas?

Installing Visual Studio Build Tools for other (all) users?

First of all, thanks a ton for creating Windows Build Tools!

Now, on to my problem: I installed Windows Build Tools in a default location, but would like to allow other users of the same computer to be able to run npm install to set up my project.

First they had problems with finding Python, but that was easily fixed by adding C:\Users\<my_username>\.windows-build-tools\python27 to their respective PATH's.

Then, a wild "MSBUILD : error MSB3428: Could not load the Visual C++ component VCBuild.exe." appeared. I thought maybe adding C:\Program Files (x86)\MSBuild\14.0\Bin (is this the correct location?) to PATH would help, but it didn't.

Do you have any ideas how to fix that? Am I using the correct path to the MS build tools?

OS: Windows Server 2012 R2
Node: 6.9.2
NPM: 3.10.9

error when installing python

tried to install via PowerShell run as admin

PS C:\Users\Thaem\Desktop\coding projects\lagooner> npm install --global --production windows-build-tools

[email protected] postinstall C:\Users\Thaem\AppData\Roaming\npm\node_modules\windows-build-tools
node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.11.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\Thaem.windows-build-tools\python-2.7.11.msi.
Starting installation...
events.js:161
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:1023:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "ins
tall" "--global" "--production" "windows-build-tools"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node ./lib/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Thaem\Desktop\coding projects\lagooner\npm-debug.log

Can't find PowerShell.exe

This is a previously marked error, true but no proper fix was given. The earlier filed issue suggested a fix of adding WindowsPowerShell/v1.0 to your PATH but, this did not work.
I am on Windows 8.1, using an elevated PowerShell instance.
err

Below is the npm-debug file.
npm-debug.txt

windows-build-tools not installing Windows SDK 8.1?

From the comment here, it seems like installing windows-build-tools should also install the Windows SDK 8.1.

From a win 10 machine, I ran (from administrator cmd prompt):

npm install windows-build-tools -g
npm install aglio

with this output:

> [email protected] install C:\dev\archon\webhooks\docs\node_modules\protagonist
> node-gyp rebuild


C:\dev\archon\webhooks\docs\node_modules\protagonist>if not defined npm_config_node_gyp (node "C:\Users\chad.lee\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Warning: Missing input files:
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-SchemaTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-RefractDataStructureTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-RefractSourceMapTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-RefractParseResultTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-SerializeResultTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-SerializeSourceMapTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-ElementFactoryTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-ApplyVisitorTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-CAPI.c
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-ExtendElementTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-drafter.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-RenderTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-CircularReferenceTest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-RefractAPITest.cc
C:\dev\archon\webhooks\docs\node_modules\protagonist\build\drafter\..\..\drafter\test\test-OneOfTest.cc
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dev\archon\w
ebhooks\docs\node_modules\protagonist\build\drafter\libdrafter.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dev\archon\w
ebhooks\docs\node_modules\protagonist\build\drafter\ext\snowcrash\libmarkdownparser.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dev\archon\w
ebhooks\docs\node_modules\protagonist\build\drafter\ext\snowcrash\libsnowcrash.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dev\archon\w
ebhooks\docs\node_modules\protagonist\build\drafter\libsos.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\dev\archon\w
ebhooks\docs\node_modules\protagonist\build\drafter\ext\snowcrash\libsundown.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\chad.lee\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\chad.lee\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\dev\archon\webhooks\docs\node_modules\protagonist
gyp ERR! node -v v6.2.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\chad.lee\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "aglio" "--save-dev"
npm ERR! node v6.2.2
npm ERR! npm  v3.10.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the protagonist package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs protagonist
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls protagonist
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\dev\archon\webhooks\docs\npm-debug.log

Relevant line being MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK...

Is this something windows-build-tools should have installed and made available?

err

"Please restart this script from an administrative PowerShell";
node v4.4
npm v3.3

issue installing bcrypt

I am getting this error
else (node "" rebuild )
E:\notepad\node\Fast Record\nodeauth\node_modules\bcrypt\build\bcrypt_lib.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Whatshould I do?

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

C:\Users\defaultuser>npm install --global windows-build-tools

[email protected] postinstall C:\Users\defaultuser\AppData\Roaming\npm\node_modules\windows-build-tools
node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.11.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\defaultuser.windows-build-tools\python-2.7.11.msi.
Starting installation...
events.js:163
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node ./lib/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\defaultuser\AppData\Roaming\npm-cache_logs\2017-05-04T16_26_21_866Z-debug.log

C:\Users\defaultuser>

Install uninstalled my Python?

I had Python 2.7 installed in C:\Program Files (x86)\Python27. After installing windows-build-tools, that folder is mostly empty, except for Lib and Scripts directories.

--vcc-build-tools-parameters fails to parse parameters

Hi, I'm trying to pass the /Full parameter to install the whole Build Tools package. I'm passing:

npm install --global --vcc-build-tools-parameters='[""/Full""]' --production windows-build-tools

Into the command line but no matter what parameter I pass, I get this error:

windows-build-tools Installer: Parsing additional arguments for VCC build tools failed: {} +0ms

So that means that it's not actually parsing it. Any help will be appreciated.

Options for additional contents during install?

Would it be possible to allow install options for additional MS Build Tools?

For instance, I ran into an issue where the oracledb module has a dependency on MSVCR100.dll which is part of Microsoft Visual C++ 2010 SP1 Redistributable Package. It would be awesome if windows-build-tools could optionally auto-install additional contents such as this.

32Bit: Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)
http://www.microsoft.com/de-de/download/details.aspx?id=8328

64Bit: Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
http://www.microsoft.com/en-us/download/details.aspx?id=13523

Error in tailer.js

C:\nvm\v0.10.27\node_modules\windows-build-tools\lib\install\tailer.js:9
f (typeof superClass !== "function" && superClass !== null) { throw new TypeEr
                                                                    ^
TypeError: Super expression must either be null or a function, not object
    at _inherits (C:\nvm\v0.10.27\node_modules\windows-build-tools\lib\install\t
ailer.js:9:113)
    at C:\nvm\v0.10.27\node_modules\windows-build-tools\lib\install\tailer.js:19
:3
    at Object.<anonymous> (C:\nvm\v0.10.27\node_modules\windows-build-tools\lib\
install\tailer.js:140:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\nvm\v0.10.27\node_modules\windows-build-tools\lib\
install\index.js:11:14)

This is on Window 7 Enterprise SP1, node version v0.10.27, npm version 1.4.8

run as administrator successfully installs to the wrong user

Environment

Windows 10: Version 1607 (OS Build 14393.953)
node: v4.7.3
npm: 4.3.0
node-gyp: v3.6.0

Repro steps

  1. run cmd.exe as administrator (admin) while logged in as non-administrator account (me).
  2. install windows-build-tools successfully. Tools are installed here:
C:\Users\admin\AppData\Roaming\npm\node_modules\windows-build-tools
  1. attempt to use windows-build-tools from non-administrator account fails.
F:\tests\kerberos>npm install

> [email protected] install F:\tests\kerberos
> (node-gyp rebuild) || (exit 0)


F:\tests\kerberos>if not defined npm_config_node_gyp (node "C:\Users\Bruce\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framew
ork 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it i
s installed elsewhere.  [F:\tests\kerberos\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Bruce\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Bruce\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\tests\kerberos
gyp ERR! node -v v4.7.3
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

Note 1: node-gyp installed in 2 places

C:\Users\admin\AppData\Roaming\npm
C:\Users\me\AppData\Roaming\npm

Note 2: I tried logging out and logging back in to make sure my cmd windows were getting all the proper settings.

Workaround [IGNORE see Workaround in my next comment]

prepend PATH environment variable with admin tools path:

set PATH=C:\Users\admin\AppData\Roaming\npm;%PATH%

Then it has no trouble building Kerberos

Comments

Does installing windows-build-tools take into account this scenario? Or is it expecting the user to be an admin?

Running cmd.exe as administrator sets the USERPROFILE to the admin user account C:\Users\admin. This surprised me. I had expected admin credentials but still my account.

I examined control panel->System->Advanced system settings->Environment Variables and I could not find C:\Users\admin\AppData\Roaming\npm anywhere. Nor could I find C:\Users\me\AppData\Roaming\npm

Error on Windows XP

I'm trying to install this on an old machine.

When I type...

npm install --global --production windows-build-tools > output.log

... the response on the console is...

events.js:141
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:907:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
npm ERR! Windows_NT 5.1.2600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs
node_modules\npm\bin\npm-cli.js" "install" "--global" "--production" "windows
-build-tools"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
...`

Here are the files created:

Any ideas on what to try?

Is it free for commercial (enterprise) use?

As I understand, this package (set of tools) is free for open source and non-commercial use.

Can you elaborate more on is it free for commercial (enterprise) use?

Any links will be appreciated.
Thanks

Request for BuildTools_Full.exe times out, possibly b/c of proxy

When trying to npm i -g --production windows-build-tools, the postinstall script fails with a timeout when trying to download BuildTools_Full.exe (I'm running from an elevated cmd.exe on Windows 10):

C:\WINDOWS\system32>node --version
v6.4.0

C:\WINDOWS\system32>npm i -g --production windows-build-tools
(node:16288) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

> [email protected] postinstall C:\Users\{{my user}}\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
Error: connect ETIMEDOUT 104.123.2.47:80
{ Error: connect ETIMEDOUT 104.123.2.47:80
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1081:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '104.123.2.47',
  port: 80 }

I'm behind a corporate proxy (http://proxy:8080), have npm configured to use it, and npm works successfully with it.

Is windows-build-tools known to work behind proxies? Is there a way (e.g. via environment variables) to tell it the proxy to use? Am I missing something?

Error when installing

C:\Windows\system32>npm install -g windows-build-tools

[email protected] postinstall C:\Users\fisher\AppData\Roaming\npm\node_modules\windows-build-tools
node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.11.msi
[============================================>] 100.0% of 18.64 MB (6.09 kB/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\fisher.windows-build-tools\python-2.7.11.msi.
Starting installation...
events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\ProgramFiles\Node.js\node.exe" "C:\Users\fisher\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "windows-build-tools"
npm ERR! node v6.9.1
npm ERR! npm v3.9.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node ./lib/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log

installation fail due to undefined exception.

Downloaded python-2.7.11.msi. Saved to C:\Users\Moeen.windows-build-tools\python-2.7.11.msi.
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Waiting for installers... |C:\Users\Moeen\AppData\Roaming\npm\node_modules\windows-build-tools\lib\install\tailer.js:92
if (data.includes('Variable: IsInstalled = 1') || data.includes('Variabl
^
TypeError: undefined is not a function
at Tailer.handleData (C:\Users\Moeen\AppData\Roaming\npm\node_modules\windows-build-tools\lib\install\tailer.js:92:16)
at null. (C:\Users\Moeen\AppData\Roaming\npm\node_modules\windows-build-tools\lib\install\tailer.js:72:16)
at wrapper as _onTimeout
at Timer.listOnTimeout (timers.js:110:15)

Question: is there an option to turn on windows 10 sdk installer?

tldr;
The README says that the windows 10 sdk is optional and off by default, but I don't see any documentation on how to turn that on. Is there a command line option?

Long version
I've come to the conclusion I need the windows 10 sdk because I've been debugging this for a couple days. My specific issue is with installing bignum on Windows 10 64-bit. I've solved several issues before this and went so far as to do the "Option 2" installations from here. That worked, but I uninstalled all that to see if I can get it working with windows-build-tools. I think the only substantial difference is that I had installed windows 10 SDK, and I believe that includes some OpenSSL tools which should fix it.

So, how do I install Windows 10 SDK with windows-build-tools?

The error I'm dealing with is...

LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libeay32.lib' [C:\Users\shear\Code\opentable\start-page-nodejs\node_modules\ot-abtest-client\node_modules\bignum\build\bignum.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\timmy\AppData\Roaming\nvm\v4.4.4\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14393

Add python to the path

It all works well, I can recompile node modules, but I hoped python would be installed and able to be used by other tools as well.

Could you consider adding python to the Path variable?

After the installation, I'm still receiving the error:

'python' is not recognized as an internal or external command,
operable program or batch file.

node-gyp rebuild :: after installing windows-build-tools

I'm facing hard times building my project which uses module [email protected]. Failed at the [email protected] install script 'node-gyp rebuild', even after installing windows-build-tools: https://github.com/felixrieseberg/windows-build-tools and installing VS2015 do all node-gyp prerequisites but no luck:

nodejs: 6.3.1
npm: 3.10.3
OS: Windows 10

Please advice, I attached npm-debug, if it may help to clarify the problem.

npm-debug.txt

Thanx,

Stuck after installing Visual Studio Build Tools

Seems to be stuck after installing Visual Studio Build Tools
Running for 3-4 hours.
Stopped and tried again many times but still the issue is there

> [email protected] postinstall C:\Users\Arpit Jain\AppData\Roaming\npm\
node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
[>                                            ] 0.0% (0 B/s)
Downloading python-2.7.11.msi
[>                                            ] 0.0% (0 B/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\Arpit Jain\.windows-build-tools\
python-2.7.11.msi.
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Waiting for installers... \Successfully installed Visual Studio Build Tools.
Waiting for installers... \

Python 2.7 is installed and PATH variables are set.

I can't thank you enough for making this

I have to support node modules in node-webkit on Windows and building is always a nightmare.

I can not thank every contributor of this project enough. Thank you so much!

Error install windows-build-tools

C:\Windows\system32>npm install --global --production windows-build-tools

[email protected] postinstall C:\Users\Alexander\AppData\Roaming\npm\n
ode_modules\windows-build-tools
node ./lib/index.js

... and 1 more

... and 1 more
Downloaded python-2.7.11.msi. Saved to C:\Users\Alexander.windows-build-tools\p
ython-2.7.11.msi.
Starting installation...
events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:1007:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs
node_modules\npm\bin\npm-cli.js" "install" "--global" "--production" "windows
-build-tools"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node ./lib/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/
index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools p
ackage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log

Why not Python3?

This package seems to install Python 2.7, but it is supported for only 3 years. (Support is expired in 2020. See https://pythonclock.org/) Is there a plan to upgrade Python to the version 3?

Not success on Windows 10

I installed windows-build-tools follow Instruction and my computer already install python 2.7.9 vs2015,but when i install any native addon(sqlite3,pinyin),get similar error,my env:
os:win10 x64
nodejs:6.9.1
error:

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
  index.cpp
  nodejieba.cpp
  win_delay_load_hook.cc
c:\users\administrator\.node-gyp\6.9.1\include\node\v8.h(800): fatal error C107
0: 文件“c:\users\administrator\.node-gyp\6.9.1\include\node\v8.h”中的 #if/#endif 对不
匹配 (编译源文件 ..\lib\index.cpp) [D:\work\nodejs\angular\angular2-electron\node_modu
les\nodejieba\build\nodejieba.vcxproj]
c:\users\administrator\.node-gyp\6.9.1\include\node\v8.h(800): fatal error C107
0: 文件“c:\users\administrator\.node-gyp\6.9.1\include\node\v8.h”中的 #if/#endif 对不
匹配 (编译源文件 ..\lib\nodejieba.cpp) [D:\work\nodejs\angular\angular2-electron\node_
modules\nodejieba\build\nodejieba.vcxproj]

nodejieba belong to pinyin.

Not installing on Windows 7

Hello,

First of all, thanks a lot for developing this module. It's a total time saver for windows users.

I'm having this issue trying to install this package as it download all of its dependencies but gets stuck when trying to install them.
With a little debug messages into the launch.js file I finally saw this error:

File C:\...\node_modules\windows-build-tools\ps1\launch-installer.ps1 
    cannot be loaded. 
The file C:\...\node_modules\windows-build-tools\ps1\launch-installer.ps1
    is not digitally signed. 
    The script will not execute on the system. 
    Please see "get-help about_signing" for more details..
At line:1 char:5
+ & {& <<<<  'C:\Users\...\node_modules\windows-build-tools\ps1\launch-installer.ps1' - path 'C:\Users\...\.windows-build-tools' }
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

 +1ms

Any ideas about to how to get this solved?

npm install fails

C:\Users\bhargav\code\windows-build-tools [master ↑]> npm install

> [email protected] postinstall C:\Users\bhargav\code\windows-build-tools
> node ./lib/index.js

module.js:442
    throw err;
    ^

Error: Cannot find module 'C:\Users\bhargav\code\windows-build-tools\lib\index.js'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:456:3

npm WARN optional Skipping failed optional dependency /babel-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Windows_NT 10.0.14352
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\bhargav\code\windows-build-tools\npm-debug.log

Oddly enough, I also can't get babel to build the index itself, even though it's installed into node_modules:

C:\Users\bhargav\code\windows-build-tools [master ↑]> npm run build

> [email protected] build C:\Users\bhargav\code\windows-build-tools
> babel src --preset es2015 -d lib

'babel' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.14352
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `babel src --preset es2015 -d lib`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'babel src --preset es2015 -d lib'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel src --preset es2015 -d lib
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\bhargav\code\windows-build-tools\npm-debug.log

Need a way to get proxy settings to nugget

You should either check the npm environment proxy setting and pass that to nugget or allow a --proxy setting from the command line call to be able to be passed to the nugget call.

I'm behind a corp firewall and this script fails when nugget tries to download files because the proxy settings are not being used.

Hangs when installed via Chef

Normally I can install any NPM package via Chef using an execute or batch resource and a local npm install in my path. For example:

execute "test npm install with node-gyp" do
  code "call npm install --global node-gyp"
end

works just fine.

However, this particular package always hangs the Chef process:

execute "test npm install windows-build-tools" do
  command "call npm install --global windows-build-tools"
end

This gets me to the end of the install process and then just hangs indefinitely (at least 2 hours):

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Waiting for installers... /Successfully installed Visual Studio Build Tools.
Successfully installed Python 2.7

Full example here: http://pastebin.com/qHdAciqP

I can't reproduce this using npm via a local cmd, ps, or bat script, but it always occurs using the local chef client.

I've tried various combinations of call, start, cmd, and exit with no luck running this npm install without hanging the running process. The closest I've gotten was

start npm install -g windows-build-tools

which starts the process in a separate window, where it successfully completes but never closes. If I type exit 0 in that window, it returns control to the chef process which successfully completes its run. But I can't find a way to accomplish this programmatically.

I note it's also a little strange that start npm install -g windows-build-tools forces Chef to wait for the process to complete with an exit, whereas start shouldn't block the current process unless /WAIT is supplied.

I'm guessing there's some windows scripting control flow going on in the windows-build-tools install that fails to fully return control to the calling process, but I'm not super familiar with Windows administration.

Since this only occurs with this package, I believe this isn't a Chef or NPM issue, but rather a complex conflict between some behavior in this specific package and the way those tools are used on Windows.

Related: npm/npm#2938

I would greatly appreciate any advice on how I might get this working.

Is this installed correctly?

  • Platform : Windows 7 x64

image

My shell is stuck here for several minutes and I don't see any CPU / Hard Disk activity either.

CPP Project Templates not found on Windows 7

Trying to install & build the LevelDB adapter on recent node.js results in:

...\leveldown\deps\leveldb\leveldb.vcxproj(20,3): error MSB4019: The imported project "S:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Allocation failed - process out of memory

I tried npm i -g windows-build-tools but never got it to work.

Tried Windows 7 and Windows 10, with both Node 6.2.2 and Node 4.4.7 (all x64, but also tried 4.4.7 x32 on W7).

Always the same result:

PS C:\Users\Administrator> npm i -g windows-build-tools
-
> [email protected] postinstall C:\Users\Administrator\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.11.amd64.msi
[============================================>] 100.0% of 19.55 MB (9.78 MB/s)
Downloaded python-2.7.11.amd64.msi. Saved to C:\Users\Administrator\.windows-build-tools\python-2.7.11.amd64.msi.
Starting installation...

<--- Last few GCs --->

   69219 ms: Scavenge 1404.0 (1457.9) -> 1404.0 (1457.9) MB, 7.1 / 0 ms (+ 0.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
   72719 ms: Mark-sweep 1404.0 (1457.9) -> 1403.9 (1457.9) MB, 3509.5 / 0 ms (+ 0.0 ms in 2 steps since start of marking, biggest step 0.0 ms) [last resort gc].
   73766 ms: Mark-sweep 1403.9 (1457.9) -> 1403.7 (1457.9) MB, 1045.6 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 000002B240FB4639 <JS Object>
    1: DefineObjectProperty [native v8natives.js:~461] [pc=000002009F582B78] (this=000001A770308071 <JS Global Object>,J=000002F7844B0D59 <an Error with map 000002517E608A91>,V=000002B240F350A9 <String[5]: stack>,G=000002F7844B0D91 <a PropertyDescriptor with map 000003F533C13149>,Y=000002B240F04211 <true>)
    2: DefineOwnProperty(aka DefineOwnProperty) [native v8natives.js:~630] [pc=00000200...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
 npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "windows-build-tools"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node ./lib/index.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./lib/index.js'.
npm ERR! This is most likely a problem with the windows-build-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Administrator\npm-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.