meanjs / generator-meanjs

MEAN.JS Official Yeoman Generator
http://meanjs.org/
473 stars 177 forks source link

Running through Zscaler - Error: unable to get local issuer certificate #233

Closed shanehaw closed 8 years ago

shanehaw commented 8 years ago

The company I work for uses a Zscaler proxy and I am trying to get the meanjs yeoman generator to work on my Windows 10 machine. So far I have managed to get npm to work by setting the proxy, https-proxy and the registry as follows:

npm config set proxy http://gateway.zscalerone.net/80
npm config set https-proxy http://gateway.zscalerone.net/80
npm config set registry http://registry.npmjs.org/

however when I run:

yo meanjs

I get the following:

Running npm install for you....
This may take a couple minutes.
Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "cd mean && npm install"
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global node-gyp@3.3.1 should be installed with -g
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack     at emitNone (events.js:67:13)
gyp ERR! stack     at TLSSocket.emit (events.js:166:7)
gyp ERR! stack     at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
gyp ERR! stack     at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\AppData\\Roaming\\nvm\\v4.4.5\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\bufferutil
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN install:bufferutil@1.2.1 bufferutil@1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil@1.2.1 Exit status 1
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack     at emitNone (events.js:67:13)
gyp ERR! stack     at TLSSocket.emit (events.js:166:7)
gyp ERR! stack     at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
gyp ERR! stack     at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\AppData\\Roaming\\nvm\\v4.4.5\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\utf-8-validate
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN install:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.2.1 Exit status 1
node-pre-gyp ERR! Tried to download: https://node-inspector.s3.amazonaws.com/debug/v0.7.7/node-v46-win32-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for v8-debug@0.7.7 and node@4.4.5 (node-v46 ABI) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack     at emitNone (events.js:67:13)
gyp ERR! stack     at TLSSocket.emit (events.js:166:7)
gyp ERR! stack     at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
gyp ERR! stack     at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\v8-debug\\build\\debug\\v0.7.7\\node-v46-win32-ia32\\debug.node" "--module_name=debug" "--module_path=C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\v8-debug\\build\\debug\\v0.7.7\\node-v46-win32-ia32" "--msvs_version=2015"
gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
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\ShaneH\Code\temp\mean\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug\build\debug\v0.7.7\node-v46-win32-ia32\debug.node --module_name=debug --module_path=C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug\build\debug\v0.7.7\node-v46-win32-ia32 --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\ShaneH\Code\temp\mean\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10240
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug
node-pre-gyp ERR! node -v v4.4.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
npm WARN eslint-config-airbnb@6.0.2 requires a peer of eslint-plugin-react@^4.0.0 but none was installed.
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" "install"
npm ERR! node v4.4.5
npm ERR! npm  v3.9.6
npm ERR! code ELIFECYCLE

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

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

    at ChildProcess.exithandler (child_process.js:213:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Which seems to indicate that it can't connect via https to

https://node-inspector.s3.amazonaws.com/debug/v0.7.7/node-v46-win32-ia32.tar.gz

I have tried setting up http_proxy and https_proxy environment variables, but this doesn't seem to have made a difference. I am also able to browse to that URL in a browser without an issue.

I assume the error has to do with the way Zscaler is handling https. Any help would be greatly appreciated.

codydaig commented 8 years ago

I would also assume that it has something to do with Zscaler and not an issue with the project. If you believe that it's an issue with the project still though, the bug should be reported to the main meanjs/mean repo. This is simply the generator. Good Luck and let us know if it is a bug!

shanehaw commented 8 years ago

Apologies if this is in the wrong place; the reason I put it here is that I get the error when running the generator.

I had a similar issue when running visual studio code - when I tried to install any extensions it also gave me the error unable to get local issuer certificate. When I researched it further I found they provided a setting:

// Whether the proxy server certificate should be verified against the list of supplied CAs.
"http.proxyStrictSSL": true,

which, when set to false managed to reach whichever server it was trying to reach through SSL. So I suppose I was hoping that there would be an equivalent setting or parameter I could pass into the yeoman generator to also get through Zscaler.

Regardless, I understand what you are saying; I will just have to make another plan.

Thank you for your reply.