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

gyp ERR! stack FetchError: request to https://nodejs.org/download/...headers.tar.gz failed, reason: unable to get local issuer certificate #3686

Open
andig opened this issue Jan 11, 2022 · 25 comments

Comments

@andig
Copy link

andig commented Jan 11, 2022

Details

Unable to run

NODE_TLS_REJECT_UNAUTHORIZED=0 node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.13.1 | darwin | arm64
gyp info find Python using Python version 3.9.9 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
gyp http GET https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
(node:83205) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz failed, reason: unable to get local issuer certificate
gyp ERR! stack     at ClientRequest.<anonymous> (/opt/homebrew/lib/node_modules/node-gyp/node_modules/minipass-fetch/lib/index.js:110:14)
gyp ERR! stack     at ClientRequest.emit (node:events:390:28)
gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:447:9)
gyp ERR! stack     at TLSSocket.emit (node:events:402:35)
gyp ERR! stack     at emitErrorNT (node:internal/streams/destroy:157:8)
gyp ERR! stack     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
gyp ERR! System Darwin 21.2.0
gyp ERR! command "/opt/homebrew/Cellar/node@16/16.13.1_1/bin/node" "/opt/homebrew/bin/node-gyp" "configure"
gyp ERR! cwd /Users/andig/htdocs/evcc
gyp ERR! node -v v16.13.1
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok

I've worked through all related issues (SO and nodejs/node-gyp#695), ensure that:

  • no http proxy
  • no ZScaler
  • no VPN tunnel
  • can access file using curl
  • node 14 working fine

Node.js version

❯ node --version
v16.13.1

❯ node-gyp --version
v8.4.1

Example code

No response

Operating system

OSX Darwin 21.2.0

Scope

Installation

Module and version

Not applicable.

@andrew-ignatiev
Copy link

If anyone else experience the same issue, it can be resolved as follow:

@andig
Copy link
Author

andig commented Jan 13, 2022

Thank you @andrew-ignatiev that does indeed work (although for npm, but not for node-gyp configure, but I assume that is how node-gyp` works). It does not explain though why

NODE_TLS_REJECT_UNAUTHORIZED=0 node-gyp configure

wouldn't work?

@andig andig changed the title gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz failed, reason: unable to get local issuer certificate gyp ERR! stack FetchError: request to https://nodejs.org/download/...headers.tar.gz failed, reason: unable to get local issuer certificate Jan 13, 2022
@andig
Copy link
Author

andig commented Jan 25, 2022

Here's what curl shows:

❯ cd /tmp && wget https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz
--2022-01-25 11:26:41--  https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz
Resolving nodejs.org (nodejs.org)... 2606:4700:10::6814:172e, 2606:4700:10::6814:162e, 104.20.23.46, ...
Connecting to nodejs.org (nodejs.org)|2606:4700:10::6814:172e|:443... connected.
ERROR: cannot verify nodejs.org's certificate, issued by ‘CN=Sectigo RSA Domain Validation Secure Server CA,O=Sectigo Limited,L=Salford,ST=Greater Manchester,C=GB’:
  Unable to locally verify the issuer's authority.
To connect to nodejs.org insecurely, use `--no-check-certificate'.

@andig
Copy link
Author

andig commented Feb 10, 2022

What finally worked for me is #3686 (comment). However, that's obviously not a good developer experience.

@tonjohn
Copy link

tonjohn commented Jul 13, 2022

I hit this issue on node v16.14.0 and v16.16.0. However, it works fine on v16.13.1. Is anyone looking into this?

@m-salman-afzal
Copy link

m-salman-afzal commented Jul 15, 2022

Same here! I can't get it working on v16.16.0.

@Glasgesicht
Copy link

Glasgesicht commented Aug 24, 2022

If anyone else experience the same issue, it can be resolved as follow:

* cd /tmp && wget https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz

* npm config set tarball /tmp/node-v16.13.2-headers.tar.gz

* npm ci

While this used to work perfectly for me, trying the same now fails on 16.14.2 with the following error output:
is this related or a separate issue?

npm ERR! path C:\Users\<user>\Documents\SWITKVP\frontend\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
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.4 found at "C:\Users\<user>\AppData\Local\Programs\Python\Python310\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.0/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.0/win-arm64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.0/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.0/win-x86/node.lib
npm ERR! gyp ERR! Completion callback never invoked!
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\<user>\Documents\SWITKVP\frontend\node_modules\deasync
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.```

@m-salman-afzal
Copy link

for some reason, I got it working with

CXXFLAGS="--std=c++17" npm i

of course, you need to delete .lock file and node_modules folder

@mario-subo
Copy link

for some reason, I got it working with

CXXFLAGS="--std=c++17" npm i

of course, you need to delete .lock file and node_modules folder

I have tried so many things you wouldn't even believe and this actually worked! Thank you so much! I really hate these node-gyp issues!

@alexey-levenets
Copy link

alexey-levenets commented Nov 18, 2022

I have some problem with version 16.15.0:

npm ERR! code 1
npm ERR! path /Users/.../node_modules/bufferutil
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
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.15.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.15.0/node-v16.15.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.15.0/node-v16.15.0-headers.tar.gz failed, reason: unable to get local issuer certificate
npm ERR! gyp ERR! stack     at ClientRequest.<anonymous> (/Users/.../.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
npm ERR! gyp ERR! stack     at ClientRequest.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:454:9)
npm ERR! gyp ERR! stack     at TLSSocket.emit (node:events:539: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 Darwin 21.6.0
npm ERR! gyp ERR! command "/Users/.../.nvm/versions/node/v16.15.0/bin/node" "/Users/.../.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/.../node_modules/bufferutil
npm ERR! gyp ERR! node -v v16.15.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok

@ZCG-coder
Copy link

ZCG-coder commented Jan 4, 2023

Seems like it also happens with node-pty:

0 verbose cli /opt/homebrew/Cellar/node@18/18.12.1/bin/node /opt/homebrew/bin/npm
1 info using npm@8.19.2
2 info using node@v18.12.1
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/opt/homebrew/Cellar/node@18/18.12.1/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/andy/Documents/Projects/WebTerm2/server2/.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:/Users/andy/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 8ms
19 timing npm:load:configload Completed in 8ms
20 timing npm:load:mkdirpcache Completed in 0ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm install node-pty
23 verbose argv "install" "node-pty"
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 1ms
26 timing npm:load:display Completed in 2ms
27 verbose logfile logs-max:10 dir:/Users/andy/.npm/_logs
28 verbose logfile /Users/andy/.npm/_logs/2023-01-04T12_38_35_008Z-debug-0.log
29 timing npm:load:logFile Completed in 2ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 14ms
33 timing arborist:ctor Completed in 0ms
34 silly logfile start cleaning logs, removing 1 files
35 silly logfile done cleaning log files
36 timing arborist:ctor Completed in 0ms
37 timing idealTree:init Completed in 7ms
38 timing idealTree:userRequests Completed in 0ms
39 silly idealTree buildDeps
40 silly fetch manifest portfinder@^1.0.32
41 http fetch GET 200 https://registry.npmjs.org/portfinder 81ms (cache miss)
42 silly fetch manifest socket.io@^4.5.4
43 http fetch GET 200 https://registry.npmjs.org/socket.io 36ms (cache miss)
44 silly fetch manifest node-pty@*
45 http fetch GET 200 https://registry.npmjs.org/node-pty 6ms (cache hit)
46 silly placeDep ROOT node-pty@0.10.1 OK for: server@1.0.0 want: *
47 silly placeDep ROOT portfinder@1.0.32 OK for: server@1.0.0 want: ^1.0.32
48 silly placeDep ROOT socket.io@4.5.4 OK for: server@1.0.0 want: ^4.5.4
49 silly fetch manifest nan@^2.14.0
50 silly fetch manifest async@^2.6.4
51 silly fetch manifest debug@^3.2.7
52 silly fetch manifest mkdirp@^0.5.6
53 silly fetch manifest accepts@~1.3.4
54 silly fetch manifest base64id@~2.0.0
55 silly fetch manifest debug@~4.3.2
56 silly fetch manifest engine.io@~6.2.1
57 silly fetch manifest socket.io-adapter@~2.4.0
58 silly fetch manifest socket.io-parser@~4.2.1
59 http fetch GET 200 https://registry.npmjs.org/mkdirp 10ms (cache hit)
60 http fetch GET 200 https://registry.npmjs.org/debug 10ms (cache hit)
61 http fetch GET 200 https://registry.npmjs.org/nan 12ms (cache hit)
62 http fetch GET 200 https://registry.npmjs.org/debug 12ms (cache hit)
63 http fetch GET 200 https://registry.npmjs.org/async 31ms (cache miss)
64 http fetch GET 200 https://registry.npmjs.org/accepts 47ms (cache miss)
65 http fetch GET 200 https://registry.npmjs.org/socket.io-adapter 52ms (cache miss)
66 http fetch GET 200 https://registry.npmjs.org/socket.io-parser 59ms (cache miss)
67 http fetch GET 200 https://registry.npmjs.org/base64id 70ms (cache miss)
68 http fetch GET 200 https://registry.npmjs.org/engine.io 795ms (cache miss)
69 timing idealTree:#root Completed in 929ms
70 silly placeDep ROOT nan@2.17.0 OK for: node-pty@0.10.1 want: ^2.14.0
71 timing idealTree:node_modules/node-pty Completed in 1ms
72 timing idealTree:node_modules/nan Completed in 0ms
73 silly placeDep ROOT async@2.6.4 OK for: portfinder@1.0.32 want: ^2.6.4
74 silly placeDep ROOT debug@3.2.7 OK for: portfinder@1.0.32 want: ^3.2.7
75 silly placeDep ROOT mkdirp@0.5.6 OK for: portfinder@1.0.32 want: ^0.5.6
76 silly fetch manifest lodash@^4.17.14
77 silly fetch manifest ms@^2.1.1
78 silly fetch manifest minimist@^1.2.6
79 http fetch GET 200 https://registry.npmjs.org/ms 4ms (cache hit)
80 http fetch GET 200 https://registry.npmjs.org/lodash 28ms (cache miss)
81 http fetch GET 200 https://registry.npmjs.org/minimist 33ms (cache miss)
82 timing idealTree:node_modules/portfinder Completed in 38ms
83 silly placeDep ROOT lodash@4.17.21 OK for: async@2.6.4 want: ^4.17.14
84 timing idealTree:node_modules/async Completed in 1ms
85 silly placeDep ROOT ms@2.1.3 OK for: debug@3.2.7 want: ^2.1.1
86 timing idealTree:node_modules/debug Completed in 1ms
87 timing idealTree:node_modules/lodash Completed in 0ms
88 silly placeDep ROOT minimist@1.2.7 OK for: mkdirp@0.5.6 want: ^1.2.6
89 timing idealTree:node_modules/mkdirp Completed in 1ms
90 timing idealTree:node_modules/minimist Completed in 0ms
91 timing idealTree:node_modules/ms Completed in 0ms
92 silly placeDep ROOT accepts@1.3.8 OK for: socket.io@4.5.4 want: ~1.3.4
93 silly placeDep ROOT base64id@2.0.0 OK for: socket.io@4.5.4 want: ~2.0.0
94 silly placeDep node_modules/socket.io debug@4.3.4 OK for: socket.io@4.5.4 want: ~4.3.2
95 silly placeDep ROOT engine.io@6.2.1 OK for: socket.io@4.5.4 want: ~6.2.1
96 silly placeDep ROOT socket.io-adapter@2.4.0 OK for: socket.io@4.5.4 want: ~2.4.0
97 silly placeDep ROOT socket.io-parser@4.2.1 OK for: socket.io@4.5.4 want: ~4.2.1
98 silly fetch manifest mime-types@~2.1.34
99 silly fetch manifest negotiator@0.6.3
100 silly fetch manifest ms@2.1.2
101 silly fetch manifest @types/cookie@^0.4.1
102 silly fetch manifest @types/cors@^2.8.12
103 silly fetch manifest @types/node@>=10.0.0
104 silly fetch manifest cookie@~0.4.1
105 silly fetch manifest cors@~2.8.5
106 silly fetch manifest debug@~4.3.1
107 silly fetch manifest engine.io-parser@~5.0.3
108 silly fetch manifest ws@~8.2.3
109 silly fetch manifest @socket.io/component-emitter@~3.1.0
110 http fetch GET 200 https://registry.npmjs.org/negotiator 10ms (cache hit)
111 http fetch GET 200 https://registry.npmjs.org/cors 33ms (cache miss)
112 http fetch GET 200 https://registry.npmjs.org/cookie 34ms (cache miss)
113 http fetch GET 200 https://registry.npmjs.org/mime-types 44ms (cache miss)
114 http fetch GET 200 https://registry.npmjs.org/@types%2fcookie 47ms (cache miss)
115 http fetch GET 200 https://registry.npmjs.org/@types%2fcors 49ms (cache miss)
116 http fetch GET 200 https://registry.npmjs.org/ws 64ms (cache miss)
117 http fetch GET 200 https://registry.npmjs.org/engine.io-parser 84ms (cache miss)
118 http fetch GET 200 https://registry.npmjs.org/@types%2fnode 88ms (cache miss)
119 http fetch GET 200 https://registry.npmjs.org/@socket.io%2fcomponent-emitter 97ms (cache miss)
120 timing idealTree:node_modules/socket.io Completed in 106ms
121 silly placeDep ROOT mime-types@2.1.35 OK for: accepts@1.3.8 want: ~2.1.34
122 silly placeDep ROOT negotiator@0.6.3 OK for: accepts@1.3.8 want: 0.6.3
123 silly fetch manifest mime-db@1.52.0
124 http fetch GET 200 https://registry.npmjs.org/mime-db 38ms (cache miss)
125 timing idealTree:node_modules/accepts Completed in 40ms
126 timing idealTree:node_modules/base64id Completed in 0ms
127 silly fetch manifest bufferutil@^4.0.1
128 http fetch GET 200 https://registry.npmjs.org/bufferutil 27ms (cache miss)
129 silly fetch manifest utf-8-validate@^5.0.2
130 http fetch GET 200 https://registry.npmjs.org/utf-8-validate 28ms (cache miss)
131 silly placeDep ROOT @types/cookie@0.4.1 OK for: engine.io@6.2.1 want: ^0.4.1
132 silly placeDep ROOT @types/cors@2.8.13 OK for: engine.io@6.2.1 want: ^2.8.12
133 silly placeDep ROOT @types/node@18.11.18 OK for: engine.io@6.2.1 want: >=10.0.0
134 silly placeDep ROOT cookie@0.4.2 OK for: engine.io@6.2.1 want: ~0.4.1
135 silly placeDep ROOT cors@2.8.5 OK for: engine.io@6.2.1 want: ~2.8.5
136 silly placeDep node_modules/engine.io debug@4.3.4 OK for: engine.io@6.2.1 want: ~4.3.1
137 silly placeDep ROOT engine.io-parser@5.0.4 OK for: engine.io@6.2.1 want: ~5.0.3
138 silly placeDep ROOT ws@8.2.3 OK for: engine.io@6.2.1 want: ~8.2.3
139 silly fetch manifest object-assign@^4
140 silly fetch manifest vary@^1
141 http fetch GET 200 https://registry.npmjs.org/vary 30ms (cache miss)
142 http fetch GET 200 https://registry.npmjs.org/object-assign 32ms (cache miss)
143 timing idealTree:node_modules/engine.io Completed in 93ms
144 timing idealTree:node_modules/@types/cookie Completed in 0ms
145 timing idealTree:node_modules/@types/cors Completed in 0ms
146 timing idealTree:node_modules/@types/node Completed in 0ms
147 timing idealTree:node_modules/cookie Completed in 0ms
148 silly placeDep ROOT object-assign@4.1.1 OK for: cors@2.8.5 want: ^4
149 silly placeDep ROOT vary@1.1.2 OK for: cors@2.8.5 want: ^1
150 timing idealTree:node_modules/cors Completed in 1ms
151 timing idealTree:node_modules/engine.io-parser Completed in 0ms
152 silly placeDep ROOT mime-db@1.52.0 OK for: mime-types@2.1.35 want: 1.52.0
153 timing idealTree:node_modules/mime-types Completed in 1ms
154 timing idealTree:node_modules/mime-db Completed in 0ms
155 timing idealTree:node_modules/negotiator Completed in 0ms
156 timing idealTree:node_modules/object-assign Completed in 0ms
157 timing idealTree:node_modules/socket.io-adapter Completed in 0ms
158 silly placeDep ROOT @socket.io/component-emitter@3.1.0 OK for: socket.io-parser@4.2.1 want: ~3.1.0
159 silly placeDep node_modules/socket.io-parser debug@4.3.4 OK for: socket.io-parser@4.2.1 want: ~4.3.1
160 timing idealTree:node_modules/socket.io-parser Completed in 1ms
161 timing idealTree:node_modules/@socket.io/component-emitter Completed in 0ms
162 timing idealTree:node_modules/vary Completed in 0ms
163 timing idealTree:node_modules/ws Completed in 0ms
164 silly placeDep node_modules/engine.io ms@2.1.2 OK for: debug@4.3.4 want: 2.1.2
165 timing idealTree:node_modules/engine.io/node_modules/debug Completed in 1ms
166 timing idealTree:node_modules/engine.io/node_modules/ms Completed in 0ms
167 silly placeDep node_modules/socket.io-parser ms@2.1.2 OK for: debug@4.3.4 want: 2.1.2
168 timing idealTree:node_modules/socket.io-parser/node_modules/debug Completed in 0ms
169 timing idealTree:node_modules/socket.io-parser/node_modules/ms Completed in 0ms
170 silly placeDep node_modules/socket.io ms@2.1.2 OK for: debug@4.3.4 want: 2.1.2
171 timing idealTree:node_modules/socket.io/node_modules/debug Completed in 1ms
172 timing idealTree:node_modules/socket.io/node_modules/ms Completed in 0ms
173 timing idealTree:buildDeps Completed in 1216ms
174 timing idealTree:fixDepFlags Completed in 0ms
175 timing idealTree Completed in 1225ms
176 timing reify:loadTrees Completed in 1226ms
177 timing reify:diffTrees Completed in 1ms
178 silly reify moves {}
179 timing reify:retireShallow Completed in 0ms
180 timing reify:createSparse Completed in 4ms
181 timing reify:loadBundles Completed in 0ms
182 silly audit bulk request {
182 silly audit   'node-pty': [ '0.10.1' ],
182 silly audit   portfinder: [ '1.0.32' ],
182 silly audit   'socket.io': [ '4.5.4' ],
182 silly audit   nan: [ '2.17.0' ],
182 silly audit   async: [ '2.6.4' ],
182 silly audit   debug: [ '3.2.7', '4.3.4' ],
182 silly audit   mkdirp: [ '0.5.6' ],
182 silly audit   lodash: [ '4.17.21' ],
182 silly audit   ms: [ '2.1.3', '2.1.2' ],
182 silly audit   minimist: [ '1.2.7' ],
182 silly audit   accepts: [ '1.3.8' ],
182 silly audit   base64id: [ '2.0.0' ],
182 silly audit   'engine.io': [ '6.2.1' ],
182 silly audit   'socket.io-adapter': [ '2.4.0' ],
182 silly audit   'socket.io-parser': [ '4.2.1' ],
182 silly audit   'mime-types': [ '2.1.35' ],
182 silly audit   negotiator: [ '0.6.3' ],
182 silly audit   '@types/cookie': [ '0.4.1' ],
182 silly audit   '@types/cors': [ '2.8.13' ],
182 silly audit   '@types/node': [ '18.11.18' ],
182 silly audit   cookie: [ '0.4.2' ],
182 silly audit   cors: [ '2.8.5' ],
182 silly audit   'engine.io-parser': [ '5.0.4' ],
182 silly audit   ws: [ '8.2.3' ],
182 silly audit   'object-assign': [ '4.1.1' ],
182 silly audit   vary: [ '1.1.2' ],
182 silly audit   'mime-db': [ '1.52.0' ],
182 silly audit   '@socket.io/component-emitter': [ '3.1.0' ]
182 silly audit }
183 silly tarball no local data for @socket.io/component-emitter@https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz. Extracting by manifest.
184 silly tarball no local data for mime-db@https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz. Extracting by manifest.
185 silly tarball no local data for object-assign@https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz. Extracting by manifest.
186 silly tarball no local data for cookie@https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz. Extracting by manifest.
187 silly tarball no local data for @types/node@https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz. Extracting by manifest.
188 silly tarball no local data for vary@https://registry.npmjs.org/vary/-/vary-1.1.2.tgz. Extracting by manifest.
189 silly tarball no local data for @types/cors@https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz. Extracting by manifest.
190 silly tarball no local data for @types/cookie@https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz. Extracting by manifest.
191 silly tarball no local data for cors@https://registry.npmjs.org/cors/-/cors-2.8.5.tgz. Extracting by manifest.
192 silly tarball no local data for engine.io-parser@https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz. Extracting by manifest.
193 silly tarball no local data for ws@https://registry.npmjs.org/ws/-/ws-8.2.3.tgz. Extracting by manifest.
194 silly tarball no local data for socket.io-parser@https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.1.tgz. Extracting by manifest.
195 silly tarball no local data for accepts@https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz. Extracting by manifest.
196 silly tarball no local data for minimist@https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz. Extracting by manifest.
197 silly tarball no local data for base64id@https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz. Extracting by manifest.
198 silly tarball no local data for lodash@https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz. Extracting by manifest.
199 silly tarball no local data for socket.io-adapter@https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz. Extracting by manifest.
200 silly tarball no local data for mime-types@https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz. Extracting by manifest.
201 silly tarball no local data for engine.io@https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz. Extracting by manifest.
202 silly tarball no local data for mkdirp@https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz. Extracting by manifest.
203 silly tarball no local data for debug@https://registry.npmjs.org/debug/-/debug-3.2.7.tgz. Extracting by manifest.
204 silly tarball no local data for socket.io@https://registry.npmjs.org/socket.io/-/socket.io-4.5.4.tgz. Extracting by manifest.
205 silly tarball no local data for ms@https://registry.npmjs.org/ms/-/ms-2.1.3.tgz. Extracting by manifest.
206 silly tarball no local data for portfinder@https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz. Extracting by manifest.
207 silly tarball no local data for async@https://registry.npmjs.org/async/-/async-2.6.4.tgz. Extracting by manifest.
208 timing reifyNode:node_modules/engine.io/node_modules/ms Completed in 44ms
209 timing reifyNode:node_modules/socket.io-parser/node_modules/ms Completed in 45ms
210 timing reifyNode:node_modules/socket.io/node_modules/ms Completed in 45ms
211 timing reifyNode:node_modules/socket.io-parser/node_modules/debug Completed in 52ms
212 timing reifyNode:node_modules/socket.io/node_modules/debug Completed in 52ms
213 timing reifyNode:node_modules/engine.io/node_modules/debug Completed in 52ms
214 timing reifyNode:node_modules/negotiator Completed in 53ms
215 http fetch GET 200 https://registry.npmjs.org/vary/-/vary-1.1.2.tgz 47ms (cache miss)
216 timing reifyNode:node_modules/vary Completed in 58ms
217 http fetch GET 200 https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz 49ms (cache miss)
218 timing reifyNode:node_modules/object-assign Completed in 58ms
219 http fetch GET 200 https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz 48ms (cache miss)
220 timing reifyNode:node_modules/cookie Completed in 58ms
221 http fetch GET 200 https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz 48ms (cache miss)
222 timing reifyNode:node_modules/@types/cors Completed in 59ms
223 http fetch GET 200 https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz 50ms (cache miss)
224 timing reifyNode:node_modules/mime-db Completed in 59ms
225 timing reifyNode:node_modules/nan Completed in 62ms
226 http fetch GET 200 https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz 54ms (cache miss)
227 timing reifyNode:node_modules/@types/cookie Completed in 66ms
228 http fetch GET 200 https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz 56ms (cache miss)
229 timing reifyNode:node_modules/base64id Completed in 71ms
230 http fetch GET 200 https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz 71ms (cache miss)
231 timing reifyNode:node_modules/mime-types Completed in 88ms
232 http fetch GET 200 https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz 75ms (cache miss)
233 timing reifyNode:node_modules/accepts Completed in 89ms
234 http fetch GET 200 https://registry.npmjs.org/cors/-/cors-2.8.5.tgz 78ms (cache miss)
235 timing reifyNode:node_modules/cors Completed in 90ms
236 http fetch GET 200 https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz 73ms (cache miss)
237 timing reifyNode:node_modules/socket.io-adapter Completed in 90ms
238 http fetch GET 200 https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.1.tgz 82ms (cache miss)
239 timing reifyNode:node_modules/socket.io-parser Completed in 96ms
240 http fetch GET 200 https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz 88ms (cache miss)
241 timing reifyNode:node_modules/engine.io-parser Completed in 101ms
242 http fetch GET 200 https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz 84ms (cache miss)
243 timing reifyNode:node_modules/engine.io Completed in 102ms
244 http fetch GET 200 https://registry.npmjs.org/ws/-/ws-8.2.3.tgz 89ms (cache miss)
245 timing reifyNode:node_modules/ws Completed in 102ms
246 http fetch GET 200 https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz 97ms (cache miss)
247 timing reifyNode:node_modules/minimist Completed in 111ms
248 http fetch GET 200 https://registry.npmjs.org/debug/-/debug-3.2.7.tgz 96ms (cache miss)
249 timing reifyNode:node_modules/debug Completed in 114ms
250 http fetch GET 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz 97ms (cache miss)
251 timing reifyNode:node_modules/mkdirp Completed in 115ms
252 http fetch GET 200 https://registry.npmjs.org/ms/-/ms-2.1.3.tgz 96ms (cache miss)
253 timing reifyNode:node_modules/ms Completed in 115ms
254 http fetch GET 200 https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz 97ms (cache miss)
255 timing reifyNode:node_modules/portfinder Completed in 116ms
256 timing reifyNode:node_modules/node-pty Completed in 118ms
257 http fetch GET 200 https://registry.npmjs.org/socket.io/-/socket.io-4.5.4.tgz 110ms (cache miss)
258 timing reifyNode:node_modules/socket.io Completed in 129ms
259 http fetch GET 200 https://registry.npmjs.org/async/-/async-2.6.4.tgz 119ms (cache miss)
260 timing reifyNode:node_modules/async Completed in 139ms
261 http fetch GET 200 https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz 170ms (cache miss)
262 timing reifyNode:node_modules/lodash Completed in 185ms
263 http fetch GET 200 https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz 293ms (cache miss)
264 timing reifyNode:node_modules/@socket.io/component-emitter Completed in 302ms
265 http fetch GET 200 https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz 837ms (cache miss)
266 timing reifyNode:node_modules/@types/node Completed in 847ms
267 timing reify:unpack Completed in 848ms
268 timing reify:unretire Completed in 0ms
269 timing build:queue Completed in 1ms
270 timing build:link:node_modules/mkdirp Completed in 1ms
271 timing build:link Completed in 1ms
272 info run node-pty@0.10.1 install node_modules/node-pty node scripts/install.js
273 info run node-pty@0.10.1 install { code: 1, signal: null }
274 timing reify:rollback:createSparse Completed in 92ms
275 timing reify:rollback:retireShallow Completed in 1ms
276 timing command:install Completed in 2438ms
277 verbose stack Error: command failed
277 verbose stack     at ChildProcess.<anonymous> (/opt/homebrew/Cellar/node@18/18.12.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
277 verbose stack     at ChildProcess.emit (node:events:513:28)
277 verbose stack     at maybeClose (node:internal/child_process:1091:16)
277 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
278 verbose pkgid node-pty@0.10.1
279 verbose cwd /Users/andy/Documents/Projects/WebTerm2/server2
280 verbose Darwin 22.3.0
281 verbose node v18.12.1
282 verbose npm  v8.19.2
283 error code 1
284 error path /Users/andy/Documents/Projects/WebTerm2/server2/node_modules/node-pty
285 error command failed
286 error command sh -c -- node scripts/install.js
287 error gyp info it worked if it ends with ok
287 error gyp info using node-gyp@9.1.0
287 error gyp info using node@18.12.1 | darwin | arm64
287 error gyp info find Python using Python version 3.11.0 found at "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
287 error gyp http GET https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz
287 error gyp WARN install got an error, rolling back install
287 error gyp ERR! configure error 
287 error gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz failed, reason: unable to get local issuer certificate
287 error gyp ERR! stack     at ClientRequest.<anonymous> (/opt/homebrew/Cellar/node@18/18.12.1/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
287 error gyp ERR! stack     at ClientRequest.emit (node:events:513:28)
287 error gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:494:9)
287 error gyp ERR! stack     at TLSSocket.emit (node:events:525:35)
287 error gyp ERR! stack     at emitErrorNT (node:internal/streams/destroy:151:8)
287 error gyp ERR! stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
287 error gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
287 error gyp ERR! System Darwin 22.3.0
287 error gyp ERR! command "/opt/homebrew/Cellar/node@18/18.12.1/bin/node" "/opt/homebrew/Cellar/node@18/18.12.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
287 error gyp ERR! cwd /Users/andy/Documents/Projects/WebTerm2/server2/node_modules/node-pty
287 error gyp ERR! node -v v18.12.1
287 error gyp ERR! node-gyp -v v9.1.0
287 error gyp ERR! not ok
288 verbose exit 1
289 timing npm Completed in 2499ms
290 verbose unfinished npm timer reify 1672835915068
291 verbose unfinished npm timer reify:audit 1672835916302
292 verbose unfinished npm timer auditReport:getReport 1672835916302
293 verbose unfinished npm timer reify:build 1672835917152
294 verbose unfinished npm timer build 1672835917152
295 verbose unfinished npm timer build:deps 1672835917152
296 verbose unfinished npm timer build:run:install 1672835917154
297 verbose unfinished npm timer build:run:install:node_modules/node-pty 1672835917155
298 verbose code 1
299 error A complete log of this run can be found in:
299 error     /Users/andy/.npm/_logs/2023-01-04T12_38_35_008Z-debug-0.log

However, when repeated on Ubuntu Server, this no longer happens.

@sereksim
Copy link

sereksim commented Mar 28, 2023

Is there a solution that actually works? I tried every suggestion...

set NODE_TLS_REJECT_UNAUTHORIZED=0
npm install -g --unsafe-perm binding
     added 1 package in 13s
npm config set strict-ssl false
set npm_config_cafile "C:\path\to\certificate.pem"
npm config set cafile "C:\path\to\certificate.pem" --global
set NODE_EXTRA_CERTS="C:\path\to\certificate.pem"
set NODE_EXTRA_CA_CERTS="C:\path\to\certificate.pem"

... and neither node-gyp nor npm install work:

node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@18.13.0 | win32 | x64                                                                               
gyp info find Python using Python version 3.9.7 found at "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"
gyp http GET https://nodejs.org/download/release/v18.13.0/node-v18.13.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.13.0/node-v18.13.0-headers.tar.gz failed, reason: self-signed certificate in certificate chain
gyp ERR! stack     at ClientRequest.<anonymous> (C:\Users\bla\AppData\Roaming\npm\node_modules\node-gyp\node_modules\minipass-fetch\lib\index.js:130:14)
gyp ERR! stack     at ClientRequest.emit (node:events:513:28)
gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:496:9)
gyp ERR! stack     at TLSSocket.emit (node:events:525:35)
gyp ERR! stack     at emitErrorNT (node:internal/streams/destroy:151:8)
gyp ERR! stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bla\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd C:\Users\bla\my\current\directory
gyp ERR! node -v v18.13.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
npm install -g --unsafe-perm react-devtools
npm ERR! code 1
npm ERR! path C:\Users\bla\AppData\Roaming\npm\node_modules\react-devtools\node_modules\electron
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node install.js
npm ERR! RequestError: self-signed certificate in certificate chain
npm ERR!     at ClientRequest.<anonymous> (C:\Users\bla\AppData\Roaming\npm\node_modules\react-devtools\node_modules\got\dist\source\core\index.js:970:111)
npm ERR!     at Object.onceWrapper (node:events:628:26)
npm ERR!     at ClientRequest.emit (node:events:525:35)
npm ERR!     at origin.emit (C:\Users\bla\AppData\Roaming\npm\node_modules\react-devtools\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:496:9)
npm ERR!     at TLSSocket.emit (node:events:513:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR!     at TLSSocket.onConnectSecure (node:_tls_wrap:1545:34)
npm ERR!     at TLSSocket.emit (node:events:513:28)
npm ERR!     at TLSSocket._finishInit (node:_tls_wrap:959:8)
npm ERR!     at ssl.onhandshakedone (node:_tls_wrap:743:12)

This might be connected to the issues nodejs/node#3742, nodejs/node-gyp#448 and nodejs/node-gyp#695, but the recommendations there are similar to those here.

@sereksim
Copy link

sereksim commented Mar 29, 2023

None of the other methods worked for me (see #3686 (comment)), but this command finally solved the problem (on Windows 11):
$env:NODE_EXTRA_CA_CERTS="C:\path\to\certificate.crt"

node-gyp and npm now work without any problems.

@denisecbiker
Copy link

i am getting this error
npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.15.0/node-v18.15.0-headers.tar.gz failed, reason: self-signed certificate in certificate chain
Api\wwwroot\node_modules\node-gyp\node_modules\minipass-fetch\lib\index.js:110:14)

how can i get round it, i am installing lastest version of node-sass
npm v9.6.3
nodejs v18.15.0
python 3.11
node-gyp@8.4.1

npmrc file is
python=C:\Python311\python.exe
loglevel=verbose
strict-ssl=false
registry=https://nexus.uat.al.intraxa/repository/npm-public/
email=deployment@al.intraxa
//nexus.uat.al.intraxa/repository/npm-public/:_auth=commentout==
always-auth=true

@mibadim
Copy link

mibadim commented Jun 26, 2023

Still no solution on this? I tried every workaround suggested in this thread. Nothing helped. Can't use Node-Gyp, neither SASS as it depends on it.

@wayneseymour
Copy link

@mibadim I just worked with my company's ops team and this what we did that worked for me (may not for you, but I hope so):

export NODE_TLS_REJECT_UNAUTHORIZED=0
then
npm config set strict-ssl true
Then I retried and it worked.

Finally, I unset NODE_TLS_REJECT_UNAUTHORIZED and it worked again.

@PawelDrabik
Copy link

I can confirm, that this solution worked for me as well.

$ export NODE_TLS_REJECT_UNAUTHORIZED=0

$ npm config set strict-ssl true

@lopaz
Copy link

lopaz commented Nov 18, 2023

in Debian, apt-get install gcc g++ make solved my problem.

@JasonFoglia
Copy link

Is there an update for on this issue?
Getting same issue on Windows 10 when using nvm to switch to later version of node, in my case node 18.14.2 from 16.14.2.

@cando-jo
Copy link

Is there any update for RHEL8? I am getting the same issue. Tried almost everything...

@igloo15
Copy link

igloo15 commented Jan 23, 2024

I as well still get this error on latest LTS Node v20.10.0

Have tried all solutions above except for downloading and setting the tar separately. Specifically when trying to build backstage.io via yarn.

Linux Ubuntu latest LTS. I know its my company's vpn proxy causing the issue but there is not much I can do about that. A more official solution/fix would be nice to have.

@weihan1394
Copy link

bumping this to see if there is any solution?

@gaollard
Copy link

@mibadim I just worked with my company's ops team and this what we did that worked for me (may not for you, but I hope so):

export NODE_TLS_REJECT_UNAUTHORIZED=0 then npm config set strict-ssl true Then I retried and it worked.

Finally, I unset NODE_TLS_REJECT_UNAUTHORIZED and it worked again.

wow, it worked

@RedYetiDev
Copy link
Member

Node.js v16 has reached EoL. If you are able to reproduce in the latest/LTS version of Node.js, please leave a comment, otherwise I'll close this is resolved. Thanks!

@tonjohn
Copy link

tonjohn commented Jul 20, 2024

Node.js v16 has reached EoL. If you are able to reproduce in the latest/LTS version of Node.js, please leave a comment, otherwise I'll close this is resolved. Thanks!

This is an issue in latest version of Node...

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