Ionic2 with electron

In this case, you’ll need to run

npm install @types/node

Since fs is part of the node API, you need the extra types.
Then you can do

import { readFileSync} from 'fs';

or any of the methods from fs