Search code examples
node.jsnpmelectronnpm-install

How to determine the electron sha256 hash


I'm trying to install electron via the cache. I can't remember how but I found the v22.0.0 sha256 hash of electron to be: 675dc6eec89d1ddd1fa1f035915944bbec766951c6cd149c5ddcc3056471a91d.

I'm now trying to update to use the latest electron v25.3.2, and I tried using the hash from the SHASUMS256.txt file for windows: 152df697cc396c8dce2c405d25ceeb2499f335dd99a66b32fd8749f6042f27d7 however this doesn't work when running npm install electron. I did a quick check and the sha256 hash for v22.0.0 was not what I had.


Solution

  • I managed to figure this out eventually, the hash is not based on the file that is stored in the folder. It is actually the hash of the download url.

    In my use case the download url was: https://github.com/electron/electron/releases/download/v25.3.2

    And the hash is: 8094ad17c1b056c796ee8402115143ac99458e895da15291d7aaa6ba8359b20c

    Then my folder looks like: AppData/Local/electron/Cache/8094ad17c1b056c796ee8402115143ac99458e895da15291d7aaa6ba8359b20c/...zip file