const fs = require ( 'fs' ) ; const electron = require ( 'electron/package.json' ) ; const rcFile = '.npmrc' ; let content = fs . readFileSync ( rcFile ) ; content = String ( content ) . replace ( /^(target=).*$/m , `$1${ electron . version }` ) ; fs . writeFileSync ( rcFile , content ) ;