Closed kristianmandrup closed 7 years ago
I also tried using bluebird and fs-readfile-promise
to no avail.
const Promise = require('bluebird');
const fs = require('fs-promise');
const readFile = require('fs-readfile-promise');
I was only able to make it work after many trial and errors:
var Bluebird = require('bluebird');
var fs = require('fs-extra-promise').usePromise(Bluebird);
let result = await fsp.readFileAsync('./details.html', 'utf8');
Kind of sad having to do this in autumn 2016...
Works fine for me with the latest version: https://runkit.com/57ebc041d4a27f140028fd78/5895e235e6ac1b00142b9028
If this issue still persists, please post a reduced test case as a runkit or github repo. Closing for now.
In the following, the last test fails, using
await fs.readFile
.Error: ENOENT: no such file or directory, open './details.html'
However using
await fs.readJson
works just fine. Any idea as to why? If I change thereadJson
toreadFile
it also fails there:Error: ENOENT: no such file or directory, open './map.json'