chore: fix dangling promise in npm install (#36379)
chore: fix dangling promise in npm install (#36379)

* Fix dangling promise introduced in #33979

* fix reject in callback

* simplify code

Co-authored-by: Black-Hole <51f1c2d6b14eabf222f1801880843358b0f772c3@gmail.com>

Co-authored-by: Black-Hole <51f1c2d6b14eabf222f1801880843358b0f772c3@gmail.com>
electron/electron,electron/electron,electron/electron,electron/electron,electron/electron,electron/electron,electron/electron