static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v16.17.0/node-v16.17.0-headers.tar.gz failed, reason: self signed certificate in certificate chain

Open gd-pgottumukkala opened this issue 3 years ago • 7 comments

Getting the following error when i run npm install -g @azure/static-web-apps-cli

Error details as below:

npm ERR! code 1 npm ERR! path C:\code\SWA\static-web-apps-cli\node_modules\keytar npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || npm run build npm ERR! > [email protected] build npm ERR! > node-gyp rebuild npm ERR! prebuild-install warn install self signed certificate in certificate chain npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.10.7 found at "C:\Users\pgottumukkala\AppData\Local\Programs\Python\Python310\python.exe" npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.0/node-v16.17.0-headers.tar.gz npm ERR! gyp WARN install got an error, rolling back install npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v16.17.0/node-v16.17.0-headers.tar.gz failed, reason: self signed certificate in certificate chain npm ERR! gyp ERR! stack at ClientRequest. (C:\code\SWA\static-web-apps-cli\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! gyp ERR! stack at ClientRequest.emit (node:events:513:28) npm ERR! gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:481:9) npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:525:35) npm ERR! gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:157:8) npm ERR! gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:122:3) npm ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21) npm ERR! gyp ERR! System Windows_NT 10.0.19044 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\code\SWA\static-web-apps-cli\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\code\SWA\static-web-apps-cli\node_modules\keytar npm ERR! gyp ERR! node -v v16.17.0 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not ok

gd-pgottumukkala avatar Sep 15 '22 17:09 gd-pgottumukkala

Hi @gd-pgottumukkala , can you please provide us a little more information on what is the environment you're using for this. We have seen similar issues with the keytar package installation on the docker and WSLs.

sgollapudi77 avatar Sep 16 '22 10:09 sgollapudi77

Hi I am trying to run in VisualStudio code on windows environment

gd-pgottumukkala avatar Sep 20 '22 14:09 gd-pgottumukkala

PS C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI> npm config set cafile C:\Material\SHA.pem
PS C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI> npm i keytar npm ERR! code 1 npm ERR! path C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\keytar npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || npm run build npm ERR! > [email protected] build npm ERR! > node-gyp rebuild npm ERR! prebuild-install warn install self signed certificate in certificate chain npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.13 found at "C:\Users\pgottumukkala\AppData\Local\Programs\Python\Python39\python.exe" npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/SHASUMS256.txt npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/win-x86/node.lib npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/win-x64/node.lib npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/win-arm64/node.lib npm ERR! gyp WARN install got an error, rolling back install npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v16.13.0/win-arm64/node.lib failed, reason: self signed certificate in certificate chain npm ERR! gyp ERR! stack at ClientRequest. (C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! gyp ERR! stack at ClientRequest.emit (node:events:390:28) npm ERR! gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:447:9) npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:402:35) npm ERR! gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:157:8) npm ERR! gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:122:3) npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\keytar npm ERR! gyp ERR! node -v v16.13.0 npm ERR! gyp ERR! node-gyp -v v9.1.0 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\pgottumukkala\AppData\Local\npm-cache_logs\2022-09-20T13_35_17_053Z-debug-0.log PS C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI> npm config set cafile C:\Material\arm-64.pem PS C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI> npm i keytar npm ERR! code 1 npm ERR! path C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\keytar npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || npm run build npm ERR! > [email protected] build npm ERR! > node-gyp rebuild npm ERR! prebuild-install warn install self signed certificate in certificate chain npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.13 found at "C:\Users\pgottumukkala\AppData\Local\Programs\Python\Python39\python.exe" npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/SHASUMS256.txt npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/win-x86/node.lib npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/win-x64/node.lib npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.0/win-arm64/node.lib npm ERR! gyp WARN install got an error, rolling back install npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v16.13.0/win-arm64/node.lib failed, reason: self signed certificate in certificate chain npm ERR! gyp ERR! stack at ClientRequest. (C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\minipass-fetch\lib\index.js:130:14) npm ERR! gyp ERR! stack at ClientRequest.emit (node:events:390:28) npm ERR! gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:447:9) npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:402:35) npm ERR! gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:157:8) npm ERR! gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:122:3) npm ERR! gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21) npm ERR! gyp ERR! System Windows_NT 10.0.19044 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI\node_modules\keytar npm ERR! gyp ERR! node -v v16.13.0 npm ERR! gyp ERR! node-gyp -v v9.1.0 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\pgottumukkala\AppData\Local\npm-cache_logs\2022-09-20T13_37_06_558Z-debug-0.log PS C:\RetailSimulatorForm\19Sept2021\PHA-SWA-PartnerHubUI>

gd-pgottumukkala avatar Sep 20 '22 14:09 gd-pgottumukkala

Hi Can we meet on call to resolve this issue?

gd-pgottumukkala avatar Sep 20 '22 14:09 gd-pgottumukkala

Any update on this issue? I ran into the same error when trying to install using Bash command prompt in Visual Studio code.

vince1273 avatar Oct 01 '22 16:10 vince1273

hitting the same issue with latest version when installing behind a zscaler installation. pointing to the cert files did not help. any hint how to install SWA in such setup. disabling the zscaler is not possible due to the in-place policies on this.

phwecker avatar Jan 11 '23 13:01 phwecker

hello Team, I am also facing same issue. How did you resolve the issue? Please help me on this ...I am stuck for 3-4 days on this issue

reddyeshwar17 avatar May 18 '23 19:05 reddyeshwar17

Hello everyone! This is how I resolved my node-gyp error

If you're on windows: Install .NET latest, on their website through a manual installation. https://dotnet.microsoft.com/en-us/download/dotnet-framework

And there's also a package for node to be able to access .net on windows https://github.com/nodejs/node-gyp#on-windows

Make sure dotnet is on Path Variables

EmaoqFilho-NTTData avatar Jun 01 '24 17:06 EmaoqFilho-NTTData

I haven't been able to reproduce this on a devcontainer, and there is a noted workaround. If anyone is still having this issue on the 1.1.10 release, please open a new issue with full details on the environment.

adrianhall avatar Jul 01 '24 18:07 adrianhall