Install node-gyp on Windows


How to Install node-gyp on Windows

Step 1:

$ npm install -g node-gyp
C:\Users\Administrator\AppData\Roaming\npm\node-gyp -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js
C:\Users\Administrator\AppData\Roaming\npm
`-- node-gyp@3.6.2
  +-- fstream@1.0.11
  | `-- inherits@2.0.3
  +-- glob@7.1.2
  | +-- fs.realpath@1.0.0
  | +-- inflight@1.0.6
  | | `-- wrappy@1.0.2
  | +-- once@1.4.0
  | `-- path-is-absolute@1.0.1
  +-- graceful-fs@4.1.11
  +-- minimatch@3.0.4
  | `-- brace-expansion@1.1.8
  |   +-- balanced-match@1.0.0
  |   `-- concat-map@0.0.1
  +-- mkdirp@0.5.1
  | `-- minimist@0.0.8
  +-- nopt@3.0.6
  | `-- abbrev@1.1.1
  +-- npmlog@4.1.2
  | +-- are-we-there-yet@1.1.4
  | | +-- delegates@1.0.0
  | | `-- readable-stream@2.3.3
  | |   +-- core-util-is@1.0.2
  | |   +-- isarray@1.0.0
  | |   +-- process-nextick-args@1.0.7
  | |   +-- string_decoder@1.0.3
  | |   `-- util-deprecate@1.0.2
  | +-- console-control-strings@1.1.0
  | +-- gauge@2.7.4
  | | +-- aproba@1.2.0
  | | +-- has-unicode@2.0.1
  | | +-- object-assign@4.1.1
  | | +-- signal-exit@3.0.2
  | | +-- string-width@1.0.2
  | | | +-- code-point-at@1.1.0
  | | | `-- is-fullwidth-code-point@1.0.0
  | | |   `-- number-is-nan@1.0.1
  | | +-- strip-ansi@3.0.1
  | | | `-- ansi-regex@2.1.1
  | | `-- wide-align@1.1.2
  | `-- set-blocking@2.0.0
  +-- osenv@0.1.4
  | +-- os-homedir@1.0.2
  | `-- os-tmpdir@1.0.2
  +-- request@2.83.0
  | +-- aws-sign2@0.7.0
  | +-- aws4@1.6.0
  | +-- caseless@0.12.0
  | +-- combined-stream@1.0.5
  | | `-- delayed-stream@1.0.0
  | +-- extend@3.0.1
  | +-- forever-agent@0.6.1
  | +-- form-data@2.3.1
  | | `-- asynckit@0.4.0
  | +-- har-validator@5.0.3
  | | +-- ajv@5.5.2
  | | | +-- co@4.6.0
  | | | +-- fast-deep-equal@1.0.0
  | | | +-- fast-json-stable-stringify@2.0.0
  | | | `-- json-schema-traverse@0.3.1
  | | `-- har-schema@2.0.0
  | +-- hawk@6.0.2
  | | +-- boom@4.3.1
  | | +-- cryptiles@3.1.2
  | | | `-- boom@5.2.0
  | | +-- hoek@4.2.0
  | | `-- sntp@2.1.0
  | +-- http-signature@1.2.0
  | | +-- assert-plus@1.0.0
  | | +-- jsprim@1.4.1
  | | | +-- extsprintf@1.3.0
  | | | +-- json-schema@0.2.3
  | | | `-- verror@1.10.0
  | | `-- sshpk@1.13.1
  | |   +-- asn1@0.2.3
  | |   +-- bcrypt-pbkdf@1.0.1
  | |   +-- dashdash@1.14.1
  | |   +-- ecc-jsbn@0.1.1
  | |   +-- getpass@0.1.7
  | |   +-- jsbn@0.1.1
  | |   `-- tweetnacl@0.14.5
  | +-- is-typedarray@1.0.0
  | +-- isstream@0.1.2
  | +-- json-stringify-safe@5.0.1
  | +-- mime-types@2.1.17
  | | `-- mime-db@1.30.0
  | +-- oauth-sign@0.8.2
  | +-- performance-now@2.1.0
  | +-- qs@6.5.1
  | +-- safe-buffer@5.1.1
  | +-- stringstream@0.0.5
  | +-- tough-cookie@2.3.3
  | | `-- punycode@1.4.1
  | +-- tunnel-agent@0.6.0
  | `-- uuid@3.2.1
  +-- rimraf@2.6.2
  +-- semver@5.3.0
  +-- tar@2.2.1
  | `-- block-stream@0.0.9
  `-- which@1.3.0
    `-- isexe@2.0.0

Step 2:

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

> windows-build-tools@1.3.2 postinstall C:\Users\Administrator\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
[============================================>] 100.0% of 3.29 MB (1.88 MB/s)
Downloading python-2.7.13.msi
[============================================>] 100.0% of 19.16 MB (1.67 MB/s)
Downloaded python-2.7.13.msi. Saved to C:\Users\Administrator\.windows-build-tools\python-2.7.13.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 Python 2.7
Waiting for installers... |Successfully installed Visual Studio Build Tools.
C:\Users\Administrator\AppData\Roaming\npm
`-- windows-build-tools@1.3.2
  +-- chalk@1.1.3
  | +-- ansi-styles@2.2.1
  | +-- escape-string-regexp@1.0.5
  | +-- has-ansi@2.0.0
  | | `-- ansi-regex@2.1.1
  | +-- strip-ansi@3.0.1
  | `-- supports-color@2.0.0
  +-- cli-spinner@0.2.7
  +-- debug@2.6.9
  | `-- ms@2.0.0
  +-- fs-extra@3.0.1
  | +-- graceful-fs@4.1.11
  | +-- jsonfile@3.0.1
  | `-- universalify@0.1.1
  `-- nugget@2.0.1
    +-- minimist@1.2.0
    +-- pretty-bytes@1.0.4
    | +-- get-stdin@4.0.1
    | `-- meow@3.7.0
    |   +-- camelcase-keys@2.1.0
    |   | `-- camelcase@2.1.1
    |   +-- decamelize@1.2.0
    |   +-- loud-rejection@1.6.0
    |   | +-- currently-unhandled@0.4.1
    |   | | `-- array-find-index@1.0.2
    |   | `-- signal-exit@3.0.2
    |   +-- map-obj@1.0.1
    |   +-- normalize-package-data@2.4.0
    |   | +-- hosted-git-info@2.5.0
    |   | +-- is-builtin-module@1.0.0
    |   | | `-- builtin-modules@1.1.1
    |   | +-- semver@5.5.0
    |   | `-- validate-npm-package-license@3.0.1
    |   |   +-- spdx-correct@1.0.2
    |   |   | `-- spdx-license-ids@1.2.2
    |   |   `-- spdx-expression-parse@1.0.4
    |   +-- object-assign@4.1.1
    |   +-- read-pkg-up@1.0.1
    |   | +-- find-up@1.1.2
    |   | | +-- path-exists@2.1.0
    |   | | `-- pinkie-promise@2.0.1
    |   | |   `-- pinkie@2.0.4
    |   | `-- read-pkg@1.1.0
    |   |   +-- load-json-file@1.1.0
    |   |   | +-- parse-json@2.2.0
    |   |   | | `-- error-ex@1.3.1
    |   |   | |   `-- is-arrayish@0.2.1
    |   |   | +-- pify@2.3.0
    |   |   | `-- strip-bom@2.0.0
    |   |   |   `-- is-utf8@0.2.1
    |   |   `-- path-type@1.1.0
    |   +-- redent@1.0.0
    |   | +-- indent-string@2.1.0
    |   | | `-- repeating@2.0.1
    |   | |   `-- is-finite@1.0.2
    |   | `-- strip-indent@1.0.1
    |   `-- trim-newlines@1.0.0
    +-- progress-stream@1.2.0
    | +-- speedometer@0.1.4
    | `-- through2@0.2.3
    |   +-- readable-stream@1.1.14
    |   | +-- core-util-is@1.0.2
    |   | +-- inherits@2.0.3
    |   | +-- isarray@0.0.1
    |   | `-- string_decoder@0.10.31
    |   `-- xtend@2.1.2
    |     `-- object-keys@0.4.0
    +-- request@2.83.0
    | +-- aws-sign2@0.7.0
    | +-- aws4@1.6.0
    | +-- caseless@0.12.0
    | +-- combined-stream@1.0.5
    | | `-- delayed-stream@1.0.0
    | +-- extend@3.0.1
    | +-- forever-agent@0.6.1
    | +-- form-data@2.3.1
    | | `-- asynckit@0.4.0
    | +-- har-validator@5.0.3
    | | +-- ajv@5.5.2
    | | | +-- co@4.6.0
    | | | +-- fast-deep-equal@1.0.0
    | | | +-- fast-json-stable-stringify@2.0.0
    | | | `-- json-schema-traverse@0.3.1
    | | `-- har-schema@2.0.0
    | +-- hawk@6.0.2
    | | +-- boom@4.3.1
    | | +-- cryptiles@3.1.2
    | | | `-- boom@5.2.0
    | | +-- hoek@4.2.0
    | | `-- sntp@2.1.0
    | +-- http-signature@1.2.0
    | | +-- assert-plus@1.0.0
    | | +-- jsprim@1.4.1
    | | | +-- extsprintf@1.3.0
    | | | +-- json-schema@0.2.3
    | | | `-- verror@1.10.0
    | | `-- sshpk@1.13.1
    | |   +-- asn1@0.2.3
    | |   +-- bcrypt-pbkdf@1.0.1
    | |   +-- dashdash@1.14.1
    | |   +-- ecc-jsbn@0.1.1
    | |   +-- getpass@0.1.7
    | |   +-- jsbn@0.1.1
    | |   `-- tweetnacl@0.14.5
    | +-- is-typedarray@1.0.0
    | +-- isstream@0.1.2
    | +-- json-stringify-safe@5.0.1
    | +-- mime-types@2.1.17
    | | `-- mime-db@1.30.0
    | +-- oauth-sign@0.8.2
    | +-- performance-now@2.1.0
    | +-- qs@6.5.1
    | +-- safe-buffer@5.1.1
    | +-- stringstream@0.0.5
    | +-- tough-cookie@2.3.3
    | | `-- punycode@1.4.1
    | +-- tunnel-agent@0.6.0
    | `-- uuid@3.2.1
    +-- single-line-log@1.1.2
    | `-- string-width@1.0.2
    |   +-- code-point-at@1.1.0
    |   `-- is-fullwidth-code-point@1.0.0
    |     `-- number-is-nan@1.0.1
    `-- throttleit@0.0.2

Step 3:
Microsoft .NET Framework 4.5.1

Step 4:
Visual C++ 2015 Build Tools (dead link)
Update new link (01/04/2019): Microsoft Build Tools 2015

Choose Custom Install, and select Windows 8.1 or Windows 10 SDKs.(depends on your windows)

Optionnal:
If you have many python version you can use this command to specific version of python to use

npm config set python python2.7

Set defaut MSVS build

npm config set msvs_version 2015 --global

1 Comment

Leave a Reply