EPERM: operation not permitted, [NodeJs] [Electron]


#1

I’m seeing this issue pretty consistently now on our attempted windows builds (for some reason occasionally it’s not an issue… but more often than not it is):

Error deleting cache file: EPERM: operation not permitted, unlink 'C:\Users\travis\AppData\Local\electron\Cache'
{ Error: EPERM: operation not permitted, rename 'C:\Users\travis\AppData\Local\electron\Cache\tmp-2284-3-system_uri-v0.4.0-win-x64.zip' -> 'C:\Users\travis\AppData\Local\electron\Cache\system_uri-v0.4.0-win-x64.zip'
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'C:\\Users\\travis\\AppData\\Local\\electron\\Cache\\tmp-2284-3-system_uri-v0.4.0-win-x64.zip',
  dest: 'C:\\Users\\travis\\AppData\\Local\\electron\\Cache\\system_uri-v0.4.0-win-x64.zip' }
C:\Users\travis\build\joshuef\safe_browser\node_modules\@maidsafe\safe-node-app\node_modules\deps_downloader\index.js:10
		throw err
		^

Having read around, it seems like it’s a common-ish issue for npm installs on windows when an antivirus or some other program may be trying to access files: https://github.com/npm/npm/issues/12059 sadly the suggested solution there is to use npm 6, which we’re already doing.

I’ve tried some suggestions I’ve read such as:

  • Increasing yarn network timeout: yarn --ignore-engines --network-timeout 700000
    -verifying cache: - npm cache verify
  • adjusting cache lock npm config set cache-lock-retries 15 (also tried at 100/500)

To no avail :frowning:

Anyone come up agains / conquered this? Any further ideas on how to avoid permission issues on install on windows?

Thanks!