Skip to content

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 #563

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

Closed
gd-pgottumukkala opened this issue Sep 15, 2022 · 9 comments
Assignees

Comments

@gd-pgottumukkala
Copy link

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! > keytar@7.9.0 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 node-gyp@9.0.0
npm ERR! gyp info using node@16.17.0 | 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

@sgollapudi77
Copy link
Contributor

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.

@gd-pgottumukkala
Copy link
Author

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

@gd-pgottumukkala
Copy link
Author

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! > keytar@7.9.0 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 node-gyp@9.1.0
npm ERR! gyp info using node@16.13.0 | 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! > keytar@7.9.0 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 node-gyp@9.1.0
npm ERR! gyp info using node@16.13.0 | 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
Copy link
Author

Hi
Can we meet on call to resolve this issue?

@vince1273
Copy link

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

@phwecker
Copy link

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.

@reddyeshwar17
Copy link

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

@EmaoqFilho-NTTData
Copy link

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

@adrianhall
Copy link
Member

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.

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