Fix EACCES: permission denied, open '/tmp/flaresolverr.txt'. Resolves #120

This commit is contained in:
ngosang 2021-05-30 11:38:20 +02:00
parent 05f8ef95d9
commit 5da5156851

View File

@ -36,14 +36,14 @@ function validateEnvironmentVariables() {
}
async function testChromeInstallation() {
log.debug("Testing Chrome installation...")
const sessionId = UUIDv1()
// create a temporary file for testing
log.debug("Testing Chrome installation...")
const fileContent = `flaresolverr_${version}`
const filePath = path.join(os.tmpdir(), 'flaresolverr.txt')
const filePath = path.join(os.tmpdir(), `flaresolverr_${sessionId}.txt`)
const fileUrl = `file://${filePath}`
fs.writeFileSync(filePath, fileContent)
// launch the browser
const sessionId = UUIDv1()
const session = await sessions.create(sessionId, {
userAgent: null,
oneTimeSession: true