I've looked at probably 20+ questions relating to this error of installing npm modules and getting a node-pre-gyp or libxmls errors on Windows. Most of the questions are more than a year old, so thought I'd ask this in June 2019 in case there were people still having issues!
This particular error is happening with the module excel-as-json
.
- node version - 8.11.0
- npm version - 5.6.0
- Windows 10
- I am behind a corporate firewall, I've set the
npm config set http-proxy
,npm config set https-proxy
npm config set registry `http://registry.npmjs.org/
- I've installed the windows-build-tools (though it only seems to install in the admin user, I copied and pasted what was installed into the non-admin user).
- Occasionally I get an error when I try to run this with
npm install -g excel-as-json --proxy http://proxy.host.com:8080
gyp ERR! stack Error: Can't find Python executable "C:\Users\User\AppData\Local\Programs\Python27", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Users\User\AppData\Roaming\nvm\v8.11.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19) gyp ERR! stack at PythonFinder. (C:\Users\User\AppData\Roaming\nvm\v8.11.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16) gyp ERR! stack at C:\Users\User\AppData\Roaming\nvm\v8.11.0\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
Please help! I've spent about 14 hours trying to trouble shoot this and I have no idea.
C:\Users\User>npm install -g excel-as-json
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
> libxmljs@0.18.8 install C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs
> node-pre-gyp install --fallback-to-build --loglevel http
node-pre-gyp http GET https://github.com/libxmljs/libxmljs/releases/download/v0.18.8/node-v57-win32-x64.tar.gz
node-pre-gyp http 400 https://github.com/libxmljs/libxmljs/releases/download/v0.18.8/node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(400): https://github.com/libxmljs/libxmljs/releases/download/v0.18.8/node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for libxmljs@0.18.8 and node@8.11.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 400 status code downloading tarball https://github.com/libxmljs/libxmljs/releases/download/v0.18.8/node-v57-win32-x64.tar.gz
gyp http GET https://nodejs.org/download/release/v8.11.0/node-v8.11.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
gyp ERR! stack at emitNone (events.js:106:13)
gyp ERR! stack at TLSSocket.emit (events.js:208:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:639:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\nvm\\v8.11.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--loglevel=http" "--module=C:\\Program Files\\nodejs\\node_modules\\excel-as-json\\node_modules\\libxmljs\\build\\Release\\xmljs.node" "--module_name=xmljs" "--module_path=C:\\Program Files\\nodejs\\node_modules\\excel-as-json\\node_modules\\libxmljs\\build\\Release" "--napi_version=1" "--node_abi_napi=napi" "--python=C:\\Users\\User\\AppData\\Local\\Programs\\Python27\\python2.7.exe"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs
gyp ERR! node -v v8.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\User\AppData\Roaming\nvm\v8.11.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --loglevel=http --module=C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs\build\Release\xmljs.node --module_name=xmljs --module_path=C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs\build\Release --napi_version=1 --node_abi_napi=napi --python=C:\Users\User\AppData\Local\Programs\Python27\python2.7.exe' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\User\AppData\Roaming\nvm\v8.11.0\node_modules\excel-as-json\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\excel-as-json\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--loglevel" "http"
node-pre-gyp ERR! cwd C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs
node-pre-gyp ERR! node -v v8.11.0
node-pre-gyp ERR! node-pre-gyp -v v0.9.1
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\James1.Hicks\AppData\Roaming\nvm\v8.11.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --loglevel=http --module=C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs\build\Release\xmljs.node --module_name=xmljs --module_path=C:\Program Files\nodejs\node_modules\excel-as-json\node_modules\libxmljs\build\Release --napi_version=1 --node_abi_napi=napi --python=C:\Users\James1.Hicks\AppData\Local\Programs\Python27\python2.7.exe' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libxmljs@0.18.8 install: `node-pre-gyp install --fallback-to-build --loglevel http`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxmljs@0.18.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.