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

npm Install Electron Failures #577

Open
aaronxiong1991 opened this issue Feb 4, 2022 · 4 comments
Open

npm Install Electron Failures #577

aaronxiong1991 opened this issue Feb 4, 2022 · 4 comments

Comments

@aaronxiong1991
Copy link

Getting the following error when try to install the electron package

Start npm install...
npm install

[email protected] postinstall C:\Users[Account]\Downloads[ProjectName]\obj\Host\node_modules\electron
node install.js

RequestError: unable to get local issuer certificate
at ClientRequest. (C:\Users[Account]\Downloads[ProjectName]\obj\Host\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:327:22)
at ClientRequest.origin.emit (C:\Users[Account]\Downloads[ProjectName]\obj\Host\node_modules@szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users[Account]\AppData\Roaming\npm-cache_logs\2022-02-04T00_18_50_759Z-debug.log

ElectronHostHook handling started...
Invoke electron.cmd - in dir: C:\Users[Account]\Downloads[ProjectName]\obj\Host\node_modules.bin
electron.cmd "....\main.js"
internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module 'C:\Users[Account]\Downloads[ProjectName]\obj\Host\node_modules\electron\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

@detronetdip
Copy link

Try running npm config set strict-ssl false this first

@aaronxiong1991
Copy link
Author

I google about this error, and try the above npm command already, does not resolve the issue

@ghost
Copy link

ghost commented Feb 14, 2022

if you are on a non windows platform put sudo npm install

@iMactool
Copy link

╭─[Account]@[Account]-Max.local ~/learns/electron-quick-start ‹main›
╰─➤ npm install 130 ↵
npm ERR! code 1
npm ERR! path /Users/[Account]/learns/electron-quick-start/node_modules/electron
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! RequestError: socket hang up
npm ERR! at ClientRequest. (/Users/[Account]/learns/electron-quick-start/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 ClientRequest.origin.emit (/Users/[Account]/learns/electron-quick-start/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
npm ERR! at TLSSocket.socketOnEnd (node:_http_client:518:9)
npm ERR! at TLSSocket.emit (node:events:525:35)
npm ERR! at endReadableNT (node:internal/streams/readable:1358:12)
npm ERR! at connResetException (node:internal/errors:705:14)
npm ERR! at TLSSocket.socketOnEnd (node:_http_client:518:23)
npm ERR! at TLSSocket.emit (node:events:525:35)
npm ERR! at endReadableNT (node:internal/streams/readable:1358:12)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21)

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/[Account]/.npm/_logs/2023-08-26T08_10_29_099Z-debug-0.log

2023-08-26T08_10_29_099Z-debug-0.log

0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 0ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/[Account]/learns/electron-quick-start/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/Users/[Account]/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 3ms
19 timing npm:load:configload Completed in 3ms
20 timing npm:load:mkdirpcache Completed in 2ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm install
23 verbose argv "install"
24 timing npm:load:setTitle Completed in 4ms
25 timing config:load:flatten Completed in 1ms
26 timing npm:load:display Completed in 2ms
27 verbose logfile logs-max:10 dir:/Users/[Account]/.npm/_logs
28 verbose logfile /Users/[Account]/.npm/_logs/2023-08-26T08_10_29_099Z-debug-0.log
29 timing npm:load:logFile Completed in 3ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 15ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 1 files
35 silly logfile done cleaning log files
36 timing idealTree:init Completed in 21ms
37 timing idealTree:userRequests Completed in 0ms
38 silly idealTree buildDeps
39 timing idealTree:#root Completed in 0ms
40 timing idealTree:buildDeps Completed in 0ms
41 timing idealTree:fixDepFlags Completed in 0ms
42 timing idealTree Completed in 22ms
43 timing reify:loadTrees Completed in 26ms
44 timing reify:diffTrees Completed in 1ms
45 silly reify moves {}
46 timing reify:retireShallow Completed in 1ms
47 timing reify:createSparse Completed in 5ms
48 timing reify:loadBundles Completed in 0ms
49 silly audit bulk request {
49 silly audit   '@electron/get': [ '2.0.2' ],
49 silly audit   '@sindresorhus/is': [ '4.6.0' ],
49 silly audit   '@szmarczak/http-timer': [ '4.0.6' ],
49 silly audit   '@types/cacheable-request': [ '6.0.3' ],
49 silly audit   '@types/http-cache-semantics': [ '4.0.1' ],
49 silly audit   '@types/keyv': [ '3.1.4' ],
49 silly audit   '@types/node': [ '18.15.11' ],
49 silly audit   '@types/responselike': [ '1.0.0' ],
49 silly audit   '@types/yauzl': [ '2.10.0' ],
49 silly audit   boolean: [ '3.2.0' ],
49 silly audit   'buffer-crc32': [ '0.2.13' ],
49 silly audit   'cacheable-lookup': [ '5.0.4' ],
49 silly audit   'cacheable-request': [ '7.0.2' ],
49 silly audit   'clone-response': [ '1.0.3' ],
49 silly audit   debug: [ '4.3.4' ],
49 silly audit   'decompress-response': [ '6.0.0' ],
49 silly audit   'mimic-response': [ '3.1.0', '1.0.1' ],
49 silly audit   'defer-to-connect': [ '2.0.1' ],
49 silly audit   'define-properties': [ '1.1.4' ],
49 silly audit   'detect-node': [ '2.1.0' ],
49 silly audit   electron: [ '26.0.0' ],
49 silly audit   'end-of-stream': [ '1.4.4' ],
49 silly audit   'env-paths': [ '2.2.1' ],
49 silly audit   'es6-error': [ '4.1.1' ],
49 silly audit   'escape-string-regexp': [ '4.0.0' ],
49 silly audit   'extract-zip': [ '2.0.1' ],
49 silly audit   'fd-slicer': [ '1.1.0' ],
49 silly audit   'fs-extra': [ '8.1.0' ],
49 silly audit   'function-bind': [ '1.1.1' ],
49 silly audit   'get-intrinsic': [ '1.1.3' ],
49 silly audit   'get-stream': [ '5.2.0' ],
49 silly audit   'global-agent': [ '3.0.0' ],
49 silly audit   semver: [ '7.3.8', '6.3.0' ],
49 silly audit   globalthis: [ '1.0.3' ],
49 silly audit   got: [ '11.8.5' ],
49 silly audit   'graceful-fs': [ '4.2.10' ],
49 silly audit   has: [ '1.0.3' ],
49 silly audit   'has-property-descriptors': [ '1.0.0' ],
49 silly audit   'has-symbols': [ '1.0.3' ],
49 silly audit   'http-cache-semantics': [ '4.1.1' ],
49 silly audit   'http2-wrapper': [ '1.0.3' ],
49 silly audit   'json-buffer': [ '3.0.1' ],
49 silly audit   'json-stringify-safe': [ '5.0.1' ],
49 silly audit   jsonfile: [ '4.0.0' ],
49 silly audit   keyv: [ '4.5.2' ],
49 silly audit   'lowercase-keys': [ '2.0.0' ],
49 silly audit   'lru-cache': [ '6.0.0' ],
49 silly audit   matcher: [ '3.0.0' ],
49 silly audit   ms: [ '2.1.2' ],
49 silly audit   'normalize-url': [ '6.1.0' ],
49 silly audit   'object-keys': [ '1.1.1' ],
49 silly audit   once: [ '1.4.0' ],
49 silly audit   'p-cancelable': [ '2.1.1' ],
49 silly audit   pend: [ '1.2.0' ],
49 silly audit   progress: [ '2.0.3' ],
49 silly audit   pump: [ '3.0.0' ],
49 silly audit   'quick-lru': [ '5.1.1' ],
49 silly audit   'resolve-alpn': [ '1.2.1' ],
49 silly audit   responselike: [ '2.0.1' ],
49 silly audit   roarr: [ '2.15.4' ],
49 silly audit   'semver-compare': [ '1.0.0' ],
49 silly audit   'serialize-error': [ '7.0.1' ],
49 silly audit   'sprintf-js': [ '1.1.2' ],
49 silly audit   sumchecker: [ '3.0.1' ],
49 silly audit   'type-fest': [ '0.13.1' ],
49 silly audit   universalify: [ '0.1.2' ],
49 silly audit   wrappy: [ '1.0.2' ],
49 silly audit   yallist: [ '4.0.0' ],
49 silly audit   yauzl: [ '2.10.0' ]
49 silly audit }
50 timing reifyNode:node_modules/wrappy Completed in 80ms
51 timing reifyNode:node_modules/resolve-alpn Completed in 80ms
52 timing reifyNode:node_modules/universalify Completed in 81ms
53 timing reifyNode:node_modules/ms Completed in 81ms
54 timing reifyNode:node_modules/mimic-response Completed in 81ms
55 timing reifyNode:node_modules/once Completed in 81ms
56 timing reifyNode:node_modules/end-of-stream Completed in 80ms
57 timing reifyNode:node_modules/buffer-crc32 Completed in 79ms
58 timing reifyNode:node_modules/@types/keyv Completed in 80ms
59 timing reifyNode:node_modules/@types/http-cache-semantics Completed in 80ms
60 timing reifyNode:node_modules/@types/cacheable-request Completed in 80ms
61 timing reifyNode:node_modules/@types/yauzl Completed in 80ms
62 timing reifyNode:node_modules/serialize-error Completed in 82ms
63 timing reifyNode:node_modules/@types/responselike Completed in 80ms
64 timing reifyNode:node_modules/responselike Completed in 83ms
65 timing reifyNode:node_modules/quick-lru Completed in 83ms
66 timing reifyNode:node_modules/pend Completed in 83ms
67 timing reifyNode:node_modules/lowercase-keys Completed in 83ms
68 timing reifyNode:node_modules/matcher Completed in 83ms
69 timing reifyNode:node_modules/lru-cache Completed in 83ms
70 timing reifyNode:node_modules/env-paths Completed in 82ms
71 timing reifyNode:node_modules/escape-string-regexp Completed in 82ms
72 timing reifyNode:node_modules/decompress-response Completed in 83ms
73 timing reifyNode:node_modules/clone-response Completed in 83ms
74 timing reifyNode:node_modules/decompress-response/node_modules/mimic-response Completed in 83ms
75 timing reifyNode:node_modules/yallist Completed in 84ms
76 timing reifyNode:node_modules/p-cancelable Completed in 84ms
77 timing reifyNode:node_modules/jsonfile Completed in 83ms
78 timing reifyNode:node_modules/extract-zip Completed in 84ms
79 timing reifyNode:node_modules/detect-node Completed in 84ms
80 timing reifyNode:node_modules/cacheable-request Completed in 83ms
81 timing reifyNode:node_modules/pump Completed in 85ms
82 timing reifyNode:node_modules/normalize-url Completed in 85ms
83 timing reifyNode:node_modules/http-cache-semantics Completed in 84ms
84 timing reifyNode:node_modules/keyv Completed in 85ms
85 timing reifyNode:node_modules/json-buffer Completed in 84ms
86 timing reifyNode:node_modules/has Completed in 84ms
87 timing reifyNode:node_modules/get-stream Completed in 85ms
88 timing reifyNode:node_modules/defer-to-connect Completed in 85ms
89 timing reifyNode:node_modules/@szmarczak/http-timer Completed in 84ms
90 timing reifyNode:node_modules/yauzl Completed in 86ms
91 timing reifyNode:node_modules/graceful-fs Completed in 85ms
92 timing reifyNode:node_modules/cacheable-lookup Completed in 84ms
93 timing reifyNode:node_modules/progress Completed in 87ms
94 timing reifyNode:node_modules/debug Completed in 86ms
95 timing reifyNode:node_modules/semver-compare Completed in 87ms
96 timing reifyNode:node_modules/define-properties Completed in 86ms
97 timing reifyNode:node_modules/es6-error Completed in 86ms
98 timing reifyNode:node_modules/has-property-descriptors Completed in 87ms
99 timing reifyNode:node_modules/json-stringify-safe Completed in 87ms
100 timing reifyNode:node_modules/fd-slicer Completed in 87ms
101 timing reifyNode:node_modules/semver Completed in 89ms
102 timing reifyNode:node_modules/@sindresorhus/is Completed in 87ms
103 timing reifyNode:node_modules/function-bind Completed in 89ms
104 timing reifyNode:node_modules/get-intrinsic Completed in 89ms
105 timing reifyNode:node_modules/object-keys Completed in 90ms
106 timing reifyNode:node_modules/sprintf-js Completed in 90ms
107 timing reifyNode:node_modules/globalthis Completed in 90ms
108 timing reifyNode:node_modules/has-symbols Completed in 90ms
109 timing reifyNode:node_modules/http2-wrapper Completed in 91ms
110 timing reifyNode:node_modules/boolean Completed in 90ms
111 timing reifyNode:node_modules/sumchecker Completed in 94ms
112 timing reifyNode:node_modules/roarr Completed in 95ms
113 timing reifyNode:node_modules/type-fest Completed in 96ms
114 timing reifyNode:node_modules/global-agent/node_modules/semver Completed in 98ms
115 timing reifyNode:node_modules/electron Completed in 99ms
116 timing reifyNode:node_modules/fs-extra Completed in 99ms
117 timing reifyNode:node_modules/@electron/get Completed in 99ms
118 timing reifyNode:node_modules/got Completed in 101ms
119 timing reifyNode:node_modules/global-agent Completed in 102ms
120 timing reifyNode:node_modules/@types/node Completed in 111ms
121 timing reify:unpack Completed in 113ms
122 timing reify:unretire Completed in 0ms
123 timing build:queue Completed in 2ms
124 timing build:link:node_modules/electron Completed in 1ms
125 timing build:link:node_modules/extract-zip Completed in 1ms
126 timing build:link:node_modules/semver Completed in 1ms
127 timing build:link:node_modules/global-agent/node_modules/semver Completed in 1ms
128 timing build:link Completed in 1ms
129 info run [email protected] postinstall node_modules/electron node install.js
130 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 402ms
131 timing auditReport:getReport Completed in 404ms
132 silly audit report {
132 silly audit report   semver: [
132 silly audit report     {
132 silly audit report       id: 1092460,
132 silly audit report       url: 'https://github.com/advisories/GHSA-c2qf-rxjj-qqgw',
132 silly audit report       title: 'semver vulnerable to Regular Expression Denial of Service',
132 silly audit report       severity: 'moderate',
132 silly audit report       vulnerable_versions: '>=6.0.0 <6.3.1',
132 silly audit report       cwe: [Array],
132 silly audit report       cvss: [Object]
132 silly audit report     },
132 silly audit report     {
132 silly audit report       id: 1092461,
132 silly audit report       url: 'https://github.com/advisories/GHSA-c2qf-rxjj-qqgw',
132 silly audit report       title: 'semver vulnerable to Regular Expression Denial of Service',
132 silly audit report       severity: 'moderate',
132 silly audit report       vulnerable_versions: '>=7.0.0 <7.5.2',
132 silly audit report       cwe: [Array],
132 silly audit report       cvss: [Object]
132 silly audit report     }
132 silly audit report   ]
132 silly audit report }
133 timing metavuln:cache:get:security-advisory:semver:kAFjC+gZYE0hg0fnwRCthyeJmOP92DfFUBq7TwOAbcgH8333wOUXJiBMf3cV5pyGPYsWeSSSBLLcOEcTn3mGyA== Completed in 6ms
134 timing metavuln:cache:get:security-advisory:semver:efe8VB5q4mZD3/ujTc9L0aaWirUeY/ViAybQsDFvpvA+7TSAyha/N70vqCuJldXlcpql0BxojmVI2ei/NlY7rg== Completed in 5ms
135 http fetch GET 200 https://registry.npmjs.org/semver 8ms (cache hit)
136 timing metavuln:packument:semver Completed in 10ms
137 timing metavuln:load:security-advisory:semver:1092460 Completed in 1ms
138 timing metavuln:calculate:security-advisory:semver:1092460 Completed in 11ms
139 timing metavuln:load:security-advisory:semver:1092461 Completed in 0ms
140 timing metavuln:calculate:security-advisory:semver:1092461 Completed in 11ms
141 timing metavuln:cache:get:security-advisory:@electron/get:kkD38k3ACGJUqq8F1aSZEKJp2jH6I9YkI34bauLqpF0vbzM74Jq/Fou3pK/BpABrqvv51eq2pSIZYcEh/v9OoA== Completed in 6ms
142 http fetch GET 200 https://registry.npmjs.org/@electron%2fget 11ms (cache hit)
143 timing metavuln:packument:@electron/get Completed in 12ms
144 timing metavuln:load:security-advisory:@electron/get:kAFjC+gZYE0hg0fnwRCthyeJmOP92DfFUBq7TwOAbcgH8333wOUXJiBMf3cV5pyGPYsWeSSSBLLcOEcTn3mGyA== Completed in 0ms
145 timing metavuln:calculate:security-advisory:@electron/get:kAFjC+gZYE0hg0fnwRCthyeJmOP92DfFUBq7TwOAbcgH8333wOUXJiBMf3cV5pyGPYsWeSSSBLLcOEcTn3mGyA== Completed in 12ms
146 timing metavuln:cache:get:security-advisory:global-agent:2DwCrf+A4T6gsWse+QGEeh80p8qUMefOrNGzEHgtydeX6wd2IGqiKvpXmWyxWjxOi39mhBAC3MV7L0zYnXomOQ== Completed in 1ms
147 http fetch GET 200 https://registry.npmjs.org/global-agent 3ms (cache hit)
148 timing metavuln:packument:global-agent Completed in 3ms
149 timing metavuln:load:security-advisory:global-agent:efe8VB5q4mZD3/ujTc9L0aaWirUeY/ViAybQsDFvpvA+7TSAyha/N70vqCuJldXlcpql0BxojmVI2ei/NlY7rg== Completed in 0ms
150 timing metavuln:calculate:security-advisory:global-agent:efe8VB5q4mZD3/ujTc9L0aaWirUeY/ViAybQsDFvpvA+7TSAyha/N70vqCuJldXlcpql0BxojmVI2ei/NlY7rg== Completed in 3ms
151 timing auditReport:init Completed in 30ms
152 timing reify:audit Completed in 434ms
153 info run [email protected] postinstall { code: 1, signal: null }
154 timing reify:rollback:createSparse Completed in 57ms
155 timing reify:rollback:retireShallow Completed in 0ms
156 timing command:install Completed in 120477ms
157 verbose stack Error: command failed
157 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
157 verbose stack     at ChildProcess.emit (node:events:513:28)
157 verbose stack     at maybeClose (node:internal/child_process:1100:16)
157 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
158 verbose pkgid [email protected]
159 verbose cwd /Users/[Account]/learns/electron-quick-start
160 verbose Darwin 22.5.0
161 verbose node v16.20.2
162 verbose npm  v8.19.4
163 error code 1
164 error path /Users/[Account]/learns/electron-quick-start/node_modules/electron
165 error command failed
166 error command sh -c -- node install.js
167 error RequestError: socket hang up
167 error     at ClientRequest.<anonymous> (/Users/[Account]/learns/electron-quick-start/node_modules/got/dist/source/core/index.js:970:111)
167 error     at Object.onceWrapper (node:events:628:26)
167 error     at ClientRequest.emit (node:events:525:35)
167 error     at ClientRequest.origin.emit (/Users/[Account]/learns/electron-quick-start/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
167 error     at TLSSocket.socketOnEnd (node:_http_client:518:9)
167 error     at TLSSocket.emit (node:events:525:35)
167 error     at endReadableNT (node:internal/streams/readable:1358:12)
167 error     at connResetException (node:internal/errors:705:14)
167 error     at TLSSocket.socketOnEnd (node:_http_client:518:23)
167 error     at TLSSocket.emit (node:events:525:35)
167 error     at endReadableNT (node:internal/streams/readable:1358:12)
167 error     at processTicksAndRejections (node:internal/process/task_queues:83:21)
168 verbose exit 1
169 timing npm Completed in 120517ms
170 verbose unfinished npm timer reify 1693037429139
171 verbose unfinished npm timer reify:build 1693037429289
172 verbose unfinished npm timer build 1693037429289
173 verbose unfinished npm timer build:deps 1693037429289
174 verbose unfinished npm timer build:run:postinstall 1693037429292
175 verbose unfinished npm timer build:run:postinstall:node_modules/electron 1693037429292
176 verbose code 1
177 error A complete log of this run can be found in:
177 error     /Users/[Account]/.npm/_logs/2023-08-26T08_10_29_099Z-debug-0.log

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

3 participants