question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot unzip on Windows if user directory contains whitespace

See original GitHub issue

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Packager Version:
    • 14.2.1
  • Electron Version:
    • v8.0.0
  • Operating System:
    • Windows 10 (1903)
  • Last Known Working Electron Packager version::
    • unknown

Expected Behavior

electron-packager should work

Actual Behavior

electron-packager terminates with

[Error: ENOENT: no such file or directory, rename 'C:\Users\JANNIS~1\AppData\Local\Temp\electron-packager\win32-x64\VIPFY-win32-x64\electron.exe' -> 'C:\Users\JANNIS~1\AppData\Local\Temp\electron-packager\win32-x64\VIPFY-win32-x64\VIPFY.exe'] {      
  errno: -4058,
  code: 'ENOENT',
  syscall: 'rename',
  path: 'C:\\Users\\JANNIS~1\\AppData\\Local\\Temp\\electron-packager\\win32-x64\\VIPFY-win32-x64\\electron.exe',
  dest: 'C:\\Users\\JANNIS~1\\AppData\\Local\\Temp\\electron-packager\\win32-x64\\VIPFY-win32-x64\\VIPFY.exe'
}

To Reproduce

Use a user directory with whitespace, or alternatively set APPDATALOCAL environment variable to a directory with whitespace

For example in Powershell:

$env:LOCALAPPDATA = "C:\test\folder with whitespace\"
# ensure this folder exists
electron-packager . #or any electron-packager call that normally works

Additional Information

Relevant console output:

electron-packager Creating C:\Users\JANNIS~1\AppData\Local\Temp\electron-packager\win32-x64-template +16ms
  electron-packager Extracting C:\Users\Jannis Froese\AppData\Local\electron\Cache\httpsgithub.comelectronelectronreleasesdownloadv8.0.0-beta.4electron-v8.0.0-beta.4-win32-x64.zip\electron-v8.0.0-beta.4-win32-x64.zip to C:\Users\JANNIS~1\AppData\Local\Temp\electron-packager\win32-x64-template +2ms
  electron-packager Ignored paths based on the out param: [ 'C:\\Users\\Jannis Froese\\Source\\vipfy-desktop\\out' ] +0ms

Error: ENOENT: no such file or directory, rename 'C:\Users\JANNIS~1\AppData\Local\Temp\electron-packager\win32-x64\VIPFY-win32-x64\electron.exe' -> 'C:\Users\JANNIS~1\AppData\Local\Temp\electron-packager\win32-x64\VIPFY-win32-x64\VIPFY.exe'] {      
  errno: -4058,
  code: 'ENOENT',
  syscall: 'rename',
  path: 'C:\\Users\\JANNIS~1\\AppData\\Local\\Temp\\electron-packager\\win32-x64\\VIPFY-win32-x64\\electron.exe',
  dest: 'C:\\Users\\JANNIS~1\\AppData\\Local\\Temp\\electron-packager\\win32-x64\\VIPFY-win32-x64\\VIPFY.exe'
}

Manually running cross-zip-cli with the exact paths as shown in the debug output extracts the zip file correctly

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bradchristensencommented, Apr 5, 2020

@D6NK This is still an issue if the app name has a space in it though.

I’ve pinned @electron-forge/maker-zip to version 6.0.0-beta.47 to workaround this issue for now.

1reaction
maleptcommented, Feb 11, 2020

I’ve filed a bug upstream: https://github.com/feross/cross-zip/issues/23

Read more comments on GitHub >

github_iconTop Results From Across the Web

need to extract zip files having spaces in filename
1 Answer 1 · 1. cd to the directory where 7za.exe file is and alter the command to have full path to "xyz...
Read more >
Cannot Unzip File - Microsoft Community
I downloaded a zipped file from a website unto a OneDrive folder in my OneDrive account. The zipped file is 29.7 GB. I...
Read more >
unzip unable to find file with spaces in file name [duplicate]
You should use \ for the escape character so that it knows there is a space where ever there is a space in...
Read more >
Unzip a .zip which includes directories with spaces in Name
Now I have the problem that I have directories in my .zip file, which have spaces in the directory name like Jan Tester...
Read more >
7-Zip can't Extract Filenames w/ "spaces" - SourceForge
The reason for the error is that windows automatically deletes trailing spaces from directory names (Try renaming a directory to "test " and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found