it works

const util = require('util')
const fs = require('fs');
const fs_writeFile = util.promisify(fs.writeFile)

fs_writeFile('message.txt', 'Hello Node.js')
.catch((error) => {
    console.log(error)
});


Ref.

https://stackoverflow.com/questions/31978347/fs-writefile-in-a-promise-asynchronous-synchronous-stuff