Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"node-gyp configure" fails with ECONNRESET error. #1084

Closed
YaminiManthena1 opened this issue Jan 4, 2017 · 10 comments
Closed

"node-gyp configure" fails with ECONNRESET error. #1084

YaminiManthena1 opened this issue Jan 4, 2017 · 10 comments

Comments

@YaminiManthena1
Copy link

npm install -g node-gyp was successful but node-gyp configure throws the error below. Trying to upgrade node version in our application.

Mine is a Windows 7 64 bit machine.

D:\App>node-gyp configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp http GET https://nodejs.org/download/release/v6.9.2/node-v6.9.2-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:1022:11)
gyp ERR! stack at TLSWrap.onread (net.js:569:26)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\XXXX\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.j
s" "configure"
gyp ERR! cwd D:\IMVNode new version\IMV
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

@spectravp
Copy link

+1 Same issue here on Ubuntu 14.04

gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/nodejs', '/usr/bin/node-gyp', 'rebuild', '--verbose' ]
gyp info using [email protected]
gyp info using [email protected] | linux | 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 succeeded python2 /usr/bin/python2
gyp verb check python version /usr/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.6\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.9.4
gyp verb command install [ '6.9.4' ]
gyp verb install input version string "6.9.4"
gyp verb install installing version: 6.9.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 6.9.4
gyp verb ensuring nodedir is created /home/vagrant/.node-gyp/6.9.4
gyp verb created nodedir /home/vagrant/.node-gyp/6.9.4
gyp http GET https://nodejs.org/download/release/v6.9.4/node-v6.9.4-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v6.9.4/node-v6.9.4-headers.tar.gz
gyp verb extracted file from tarball include/node/android-ifaddrs.h
gyp verb extracted file from tarball include/node/ares.h
gyp verb extracted file from tarball include/node/ares_build.h
gyp verb extracted file from tarball include/node/ares_rules.h
gyp verb extracted file from tarball include/node/ares_version.h
gyp verb extracted file from tarball include/node/common.gypi
gyp verb extracted file from tarball include/node/config.gypi
gyp verb extracted file from tarball include/node/nameser.h
gyp verb extracted file from tarball include/node/node.h
gyp verb extracted file from tarball include/node/node_buffer.h
gyp verb extracted file from tarball include/node/node_object_wrap.h
gyp verb extracted file from tarball include/node/node_version.h
gyp verb extracted file from tarball include/node/pthread-barrier.h
gyp verb extracted file from tarball include/node/pthread-fixes.h
gyp verb extracted file from tarball include/node/stdint-msvc2008.h
gyp verb extracted file from tarball include/node/tree.h
gyp verb extracted file from tarball include/node/uv-aix.h
gyp verb extracted file from tarball include/node/uv-bsd.h
gyp verb extracted file from tarball include/node/uv-darwin.h
gyp verb extracted file from tarball include/node/uv-errno.h
gyp verb extracted file from tarball include/node/uv-linux.h
gyp verb extracted file from tarball include/node/uv-sunos.h
gyp verb extracted file from tarball include/node/uv-threadpool.h
gyp verb extracted file from tarball include/node/uv-unix.h
gyp verb extracted file from tarball include/node/uv-version.h
gyp verb extracted file from tarball include/node/uv-win.h
gyp verb extracted file from tarball include/node/uv.h
gyp verb extracted file from tarball include/node/v8-debug.h
gyp verb extracted file from tarball include/node/v8-experimental.h
gyp verb extracted file from tarball include/node/v8-platform.h
gyp verb extracted file from tarball include/node/v8-profiler.h
gyp verb extracted file from tarball include/node/v8-testing.h
gyp verb extracted file from tarball include/node/v8-util.h
gyp verb extracted file from tarball include/node/v8-version.h
gyp verb extracted file from tarball include/node/v8.h
gyp verb extracted file from tarball include/node/v8config.h
gyp verb extracted file from tarball include/node/zconf.h
gyp verb extracted file from tarball include/node/zlib.h
gyp verb extracted file from tarball include/node/openssl/aes.h
gyp verb extracted file from tarball include/node/openssl/asn1.h
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.9.4' ]
gyp verb remove using node-gyp dir: /home/vagrant/.node-gyp
gyp verb remove removing target version: 6.9.4
gyp verb remove removing development files for version: 6.9.4
gyp verb extracted file from tarball include/node/openssl/asn1_mac.h
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:1022:11)
gyp ERR! stack at TLSWrap.onread (net.js:569:26)
gyp ERR! System Linux 3.13.0-100-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild" "--verbose"
gyp ERR! cwd /var/www/puphpet/files/exec-once
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

@bzoz
Copy link
Contributor

bzoz commented Apr 25, 2017

@YaminiManthena1 @spectravp are you seeing those under VirtualBox?

@justinmoninger
Copy link

justinmoninger commented Apr 27, 2017

Same. My error is coming from a docker container on Cloud Foundry.

   > [email protected] install /tmp/app/node_modules/kerberos
   > (node-gyp rebuild) || (exit 0)
   
   gyp ERR! configure error
   gyp ERR! stack Error: read ECONNRESET
   gyp ERR! stack     at exports._errnoException (util.js:1022:11)
   gyp ERR! stack     at TLSWrap.onread (net.js:569:26)
   gyp ERR! System Linux 4.4.0-71-generic
   gyp ERR! command "/tmp/app/.heroku/node/bin/node" "/tmp/app/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   gyp ERR! cwd /tmp/app/node_modules/kerberos
   gyp ERR! node -v v6.9.5
   gyp ERR! node-gyp -v v3.4.0
   gyp ERR! not ok
   
   > [email protected] install /tmp/app/node_modules/ursa
   > node-gyp rebuild
   
   gyp ERR! configure error
   gyp ERR! stack Error: read ECONNRESET
   gyp ERR! stack     at exports._errnoException (util.js:1022:11)
   gyp ERR! stack     at TLSWrap.onread (net.js:569:26)
   gyp ERR! System Linux 4.4.0-71-generic
   gyp ERR! command "/tmp/app/.heroku/node/bin/node" "/tmp/app/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   gyp ERR! cwd /tmp/app/node_modules/ursa
   gyp ERR! node -v v6.9.5
   gyp ERR! node-gyp -v v3.4.0
   gyp ERR! not ok

@refack
Copy link
Contributor

refack commented Apr 27, 2017

@bzoz You had an idea?

@justinmoninger it seems like either Docker or "Cloud Foundry" is breaking your TLS connection, that might happen if they have a filter that stops the TLS handshake. Or those systems have an old CA.

You can work around this by downloading the node source tarball from https://nodejs.org/download/release/v6.9.5/ and directing node-gyp to use it instead of trying to download it, by setting export npm_config_tarball=PATH_OF_TARBALL or npm config set npm_config_tarball PATH_OF_TARBALL

@gibfahn
Copy link
Member

gibfahn commented Apr 28, 2017

@bzoz You had an idea?

I assume @bzoz suspected the bug he mentioned here nodejs/node#10286 (comment)

@bzoz
Copy link
Contributor

bzoz commented Apr 28, 2017

Exactly

@gibfahn
Copy link
Member

gibfahn commented Apr 28, 2017

You can work around this by downloading the node source tarball from https://nodejs.org/download/release/v6.9.5/ and directing node-gyp to use it instead of trying to download it, by setting export npm_config_tarball=PATH_OF_TARBALL or npm config set npm_config_tarball PATH_OF_TARBALL

FYI the tarball option won't work for Windows users, as node-gyp will try to download the node.lib files separately.


If you've installed node and npm you already have node-gyp installed (it's a dependency of npm), you just need the headers.

Assuming you're using node v6.10.1:

Headers are stored in ~/.node-gyp/6.10.1/ (or %USERPROFILE%\.node-gyp on windows), you also need the installVersion file. In later versions of node-gyp these files could change, check the contents of ~/.node-gyp on a machine with internet access when you run npm i -g node-gyp && node-gyp configure and duplicate it.

curl -O https://nodejs.org/dist/v6.10.1/node-v6.10.1-headers.tar.gz # on a computer with internet
curl -O https://nodejs.org/dist/v6.10.1/win-x64/node.lib # Windows 64-bit only
curl -O https://nodejs.org/dist/v6.10.1/win-x86/node.lib # Windows 32-bit only
# Copy header tarball to offline machine
mkdir -p  ~/.node-gyp/6.10.1
tar -xf node-v6.10.1-headers.tar.gz --directory ~/.node-gyp/6.10.1/ --strip-components 1
echo 9 >~/.node-gyp/6.10.1/installVersion

Basically the contents of ~/.node-gyp or %USERPROFILE%\.node-gyp should look like this:

6.10.1
├── include # Contains downloaded headers
└── installVersion # File, content is the number 9
└── x64 # Contains 64-bit node.lib (windows only)
└── ia32 # Contains 32-bit node.lib (windows only)
└── Release # Contains 64-bit node.lib (windows only)

npm install of native modules should now work.

@bnoordhuis
Copy link
Member

Answered, closing.

@mpkuena
Copy link

mpkuena commented Mar 2, 2018

gyp ERR! install error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:1022:11)
gyp ERR! stack at TLSWrap.onread (net.js:569:26)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Users\FOST001GEO018\AppData\Local\atom\app-1.23.2\re
sources\app\apm\bin\node.exe" "C:\Users\FOST001GEO018\AppData\Local\ato
m\app-1.23.2\resources\app\apm\node_modules\node-gyp\bin\node-gyp.js" "i
nstall" "--runtime=electro

@mpkuena
Copy link

mpkuena commented Mar 2, 2018

gyp ERR! install error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:1022:11)
gyp ERR! stack at TLSWrap.onread (net.js:569:26)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Users\FOST001GEO018\AppData\Local\atom\app-1.23.2\re
sources\app\apm\bin\node.exe" "C:\Users\FOST001GEO018\AppData\Local\ato
m\app-1.23.2\resources\app\apm\node_modules\node-gyp\bin\node-gyp.js" "i
nstall" "--runtime=electron" "--target=1.6.15" "--dist-url=https://atom.io/downl
oad/electron" "--arch=ia32" "--ensure"
gyp ERR! cwd C:\Users\FOST001GEO018.atom
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

similar error with browser plus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants