How do I stop node-gyp from trying to to download node-headers?

See original GitHub issue

I’m trying (but failing) to install gulp-sass which (I believe) is a module that must be compiled with node-gyp. I suspect that the problems I’m getting stem from a misconfiguration of my gyp setup. I’ve also raised this as an issue on the gulp-sass issue tracker:

https://github.com/dlmanning/gulp-sass/issues/530

The error seems to come quite close to the beginning of the process where it wants to get something from the Internet. Naturally this fails.

I’m working behind a corporate firewall. There’s absolutely no way I can allow desktop applications to connect to the outside world. It’s banned here.

Is there a work-around? For example, i could manually download the file that it’s trying to install and then put it on this PC to prevent it hitting the Internet.

I’m using Windows 7.

Whenever I try to install gulp-sass I get the following error:

C:\workspace\CMOTStyles>npm install --save-dev gulp-sass

> node-sass@3.9.0 install C:\workspace\CMOTStyles\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.9.0/win32-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.9.0/win32-x64-48_binding.node":

getaddrinfo ENOTFOUND github.com github.com:443

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@3.9.0 postinstall C:\workspace\CMOTStyles\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js

Building: C:\apps\nodejs\node.exe C:\workspace\CMOTStyles\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\apps\\nodejs\\node.exe',
gyp verb cli   'C:\\workspace\\CMOTStyles\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.4.0
gyp info using node@6.2.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:117:15)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:117:15) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:117:15)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\workspace\CMOTStyles\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\workspace\CMOTStyles\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\workspace\CMOTStyles\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\workspace\CMOTStyles\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:117:15) code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb check python launcher python executable found: "C:\\Python27\\python.exe"
gyp verb check python version `C:\Python27\python.exe -c "import platform; print(platform.python_version());"` returned: "2.7.10\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.2.0
gyp verb command install [ '6.2.0' ]
gyp verb install input version string "6.2.0"
gyp verb install installing version: 6.2.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 6.2.0
gyp verb ensuring nodedir is created C:\Users\NBKA0O5\.node-gyp\6.2.0
gyp verb created nodedir C:\Users\NBKA0O5\.node-gyp\6.2.0
gyp http GET https://nodejs.org/download/release/v6.2.0/node-v6.2.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.2.0' ]
gyp verb remove using node-gyp dir: C:\Users\NBKA0O5\.node-gyp
gyp verb remove removing target version: 6.2.0
gyp verb remove removing development files for version: 6.2.0
gyp ERR! configure error
gyp ERR! stack Error: This is most likely not a problem with node-gyp or the package itself and
gyp ERR! stack is related to network connectivity. In most cases you are behind a proxy or have bad
gyp ERR! stack network settings.
gyp ERR! stack     at Request.<anonymous> (C:\workspace\CMOTStyles\node_modules\node-gyp\lib\install.js:193:21)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Request.emit (events.js:188:7)
gyp ERR! stack     at Request.onRequestError (C:\workspace\CMOTStyles\node_modules\request\request.js:813:8)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at ClientRequest.emit (events.js:188:7)
gyp ERR! stack     at TLSSocket.socketErrorListener (_http_client.js:306:9)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at TLSSocket.emit (events.js:188:7)
gyp ERR! stack     at connectErrorNT (net.js:1015:8)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\apps\\nodejs\\node.exe" "C:\\workspace\\CMOTStyles\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\workspace\CMOTStyles\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v6.2.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Build failed
npm WARN enoent ENOENT: no such file or directory, open 'C:\workspace\CMOTStyles\node_modules\node-sass\package.json'
npm WARN gulp-jshint@2.0.1 requires a peer of jshint@2.x but none was installed.
npm WARN gmot_styles@0.0.1 license should be a valid SPDX license expression
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\apps\\nodejs\\node.exe" "C:\\Users\\NBKA0O5\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "gulp-sass"
npm ERR! node v6.2.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.9.0 postinstall script 'node scripts/build.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 node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

14reactions
viviancpycommented, Sep 27, 2016
  1. Download the file from “https://github.com/sass/node-sass/releases/download/v3.9.0/win32-x64-48_binding.node” and save it as , say, c:\Temp\win32-x64-48_binding.node .
  2. run SET SASS_BINARY_PATH = C:\Temp\win32-x64-48_binding.node
  3. run your npm install again.
5reactions
bnoordhuiscommented, Sep 5, 2016

node-gyp. You can set it in your .npmrc.

EDIT: Or through the npm_config_tarball and npm_config_nodedir environment variables.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent node-gyp from downloading node-headers.tar ...
1. Download https://nodejs.org/download/release/v6.10.0/node-v6.10.0-headers.tar.gz · 2. Unpack it to some local folder. · 3. Create folder Release in this local ...
Read more >
Solving common issues with node-gyp - LogRocket Blog
To use node-gyp, first, we'll need to install a Python runtime, ... The third type of bindings include V8, libuv, and Node.js header...
Read more >
node-gyp - npm
Command Options ; --devdir=$path, SDK download directory (default is OS cache directory) ; --ensure, Don't reinstall headers if already present.
Read more >
node-gyp | Yarn - Package Manager
Command Options ; --proxy=$url, Set HTTP(S) proxy for downloading header tarball ; --noproxy=$urls, Set urls to ignore proxies when downloading header tarball ;...
Read more >
ARTIFACTORY: How to download node-pre-gyp pre-compiled ...
By default, node-pre-gyp will try to download those binaries from an external resource, like github. This tutorial will leverage the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found