Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "operation not permitted, unlink chrome-err.log" #260

Closed
Junyan opened this issue Dec 10, 2021 · 1 comment · Fixed by #259
Closed

Error "operation not permitted, unlink chrome-err.log" #260

Junyan opened this issue Dec 10, 2021 · 1 comment · Fixed by #259

Comments

@Junyan
Copy link
Contributor

Junyan commented Dec 10, 2021

Environment Information

System: Windows 10
Node.js version: v14.18.1
Chrome version: 96.0.4664.55

Provide the steps to reproduce

When I use custom userDataDir, and remove it after chrome exit.

const customUserDataDir = 'D:\\.browser-temp\\chrome-4f32efbed74f445c';

const chrome = await launch({
  userDataDir: customUserDataDir
});

chrome.process.on('close', () => {
  if (fs.existsSync(customUserDataDir)) {
    const rm = fs.rmSync || fs.rmdirSync;
  
    rm(customUserDataDir)
  }
});

What is the current behavior?

(node:3204) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, unlink 'D:\\.browser-temp\\chrome-4f32efbed74f445c\\chrome-err.log'

What is the expected behavior?

The outFile and errFile should be handled by fs.closeSync when chrome exit.
@Junyan
Copy link
Contributor Author

Junyan commented Dec 10, 2021

#259 Please review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant