m4heshd / whatsapp-desktop-dark

Dark mode for WhatsApp desktop official version (Windows & macOS)
Other
625 stars 75 forks source link

npm install fails #170

Open geohuk opened 4 years ago

geohuk commented 4 years ago

Here is what I am getting:

PS C:\Users\georg\repos\whatsapp-desktop-dark> node --version
v12.16.1
PS C:\Users\georg\repos\whatsapp-desktop-dark> npm --version
6.13.4
PS C:\Users\georg\repos\whatsapp-desktop-dark> npm install

> resourcehacker@4.2.51 postinstall C:\Users\georg\repos\whatsapp-desktop-dark\node_modules\resourcehacker
> node scripts/install.js

Downloading ResourceHacker by Angus Johnson...
_http_client.js:140
  let expectedProtocol = defaultAgent.protocol;
                                      ^

TypeError: Cannot read property 'protocol' of undefined
    at new ClientRequest (_http_client.js:140:39)
    at request (http.js:46:10)
    at Object.get (http.js:50:15)
    at Object.<anonymous> (C:\Users\georg\repos\whatsapp-desktop-dark\node_modules\resourcehacker\scripts\install.js:23:20)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! resourcehacker@4.2.51 postinstall: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the resourcehacker@4.2.51 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\georg\AppData\Roaming\npm-cache\_logs\2020-03-21T21_18_22_745Z-debug.log
PS C:\Users\georg\repos\whatsapp-desktop-dark>

Tried on Windows 10 and Ubuntu 18.04. Same error.

jellydn commented 4 years ago

Hi there, I ran into this issue and found the root cause from https://github.com/felicienfrancois/node-resourcehacker/issues/6 If you downgrade to nodejs to v8 then it should work.

 ✝  ~/Projects/whatsapp-desktop-dark   master±  node -v
v8.17.0
 ✝  ~/Projects/whatsapp-desktop-dark   master±  npm -v
6.13.4
 ✝  ~/Projects/whatsapp-desktop-dark   master±  npm i
audited 2630 packages in 3.482s

1 package is looking for funding
  run `npm fund` for details

found 3 vulnerabilities (1 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details