From 5da515685154a51702d51e2477965c514a3518de Mon Sep 17 00:00:00 2001 From: ngosang Date: Sun, 30 May 2021 11:38:20 +0200 Subject: [PATCH] Fix EACCES: permission denied, open '/tmp/flaresolverr.txt'. Resolves #120 --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4215e6f..2319656 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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