Cannot install electron

I tried to install electron today but it is not working.

At first I had

npm -v
5.5.1
node -v
v8.9.1
I installed it with

npm -g i -D electron@latest

but then when I tried

electron --version

I got

throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (C:\Users\User1\AppData\Roaming\npm\node_modules\e[4melectrone[24m\index.js:14:11)
at Object. (C:\Users\User1\AppData\Roaming\npm\node_modules\e[4melectrone[24m\index.js:18:18)
e[90m at Module._compile (internal/modules/cjs/loader.js:956:30)e[39m
e[90m at Object.Module._extensions…js (internal/modules/cjs/loader.js:973:10)e[39m
e[90m at Module.load (internal/modules/cjs/loader.js:812:32)e[39m
e[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14)e[39m
e[90m at Module.require (internal/modules/cjs/loader.js:849:19)e[39m
e[90m at require (internal/modules/cjs/helpers.js:74:18)e[39m
at Object. (C:\Users\User1\AppData\Roaming\npm\node_modules\e[4melectrone[24m\cli.js:3:16)
e[90m at Module._compile (internal/modules/cjs/loader.js:956:30)e[39m

I unistalled nodejs completely and installed it again (after unistalling electron) but the result is the same

Now

node -v
v12.13.0
npm -v
6.12.0

Apparently electron requires a file path.txt that does not exist.
Any help appreciated