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

Getting the error "Operation not permitted, rmdir" on Git Bash (Windows) #3382

Closed
3 tasks done
justinfarrelldev opened this issue Oct 17, 2023 · 1 comment
Closed
3 tasks done

Comments

@justinfarrelldev
Copy link

Pre-flight checklist

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

Electron Forge version

6.4.2

Electron version

24.8.5

Operating system

Windows 11 22H2 (22621.2361)

Last known working Electron Forge version

6.4.2

Expected behavior

I expect electron-forge make --platform=win32 --overwrite --tmpdir=false to make a valid Windows app (bundled with Vite).

Actual behavior

The command fails on the "Copying files" step within "Packaging for x64 on win32" with the following error:

An unhandled rejection has occurred inside Forge:
Error: EPERM: operation not permitted, rmdir 'C:\Users\JUSTIN~1.FAR\AppData\Local\Temp\electron-packager\win32-x64\[PROJECT NAME]-win32-x64-MIJEjn\resources\app\node_modules\.cli-spinners-uvmGTKND'

Steps to reproduce

Using Git Bash and this forge.config.ts:

module.exports = {
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {},
    },
  ],
};

Simply run rm -rf .vite && electron-forge make --platform=win32 --overwrite --tmpdir=false (the .vite folder occasionally fails to be removed as well and have been removing it with rm -rf - I am unsure what is causing this, however I am not running an elevated Git Bash prompt. I have simply been running the default VS Code Git Bash terminal available once Git Bash was installed with default settings)

Additional information

Output of the electron-forge make command with DEBUG=electron-forge:*:

> rm -rf .vite && electron-forge make --platform=win32 --overwrite --tmpdir=false

⠋ Checking your system                                                                                                                                                                    
✔ Checking your system
[STARTED] Loading configuration
  electron-forge:project-resolver searching for project in: C:\Users\justin.farrell\Documents\[PROJECT NAME] +0ms
  electron-forge:project-resolver package.json with forge dependency found in C:\Users\justin.farrell\Documents\[PROJECT NAME]\package.json +6ms
[SUCCESS] Loading configuration
[STARTED] Resolving make targets
  electron-forge:require-search searching [
  '@electron-forge/maker-squirrel',
  'C:\\Users\\justin.farrell\\Documents\\[PROJECT NAME]\\@electron-forge\\maker-squirrel',
  'C:\\Users\\justin.farrell\\Documents\\[PROJECT NAME]\\node_modules\\@electron-forge\\maker-squirrel'
] relative to C:\Users\justin.farrell\Documents\[PROJECT NAME] +0ms
  electron-forge:require-search testing @electron-forge/maker-squirrel +2ms
[DATA] Making for the following targets: squirrel
[SUCCESS] Resolving make targets
[STARTED] Running package command
[STARTED] Preparing to package application
  electron-forge:project-resolver searching for project in: C:\Users\justin.farrell\Documents\[PROJECT NAME] +1s
  electron-forge:project-resolver package.json with forge dependency found in C:\Users\justin.farrell\Documents\[PROJECT NAME]\package.json +4ms
[SUCCESS] Preparing to package application
[STARTED] Running packaging hooks
[STARTED] Running generateAssets hook
[SUCCESS] Running generateAssets hook
[STARTED] Running prePackage hook
[SUCCESS] Running prePackage hook
[SUCCESS] Running packaging hooks
[STARTED] Packaging application
[DATA] Determining targets...
  electron-forge:packager packaging with options {
  asar: false,
  overwrite: true,
  ignore: [ /^\/out\//g ],
  quiet: true,
  dir: 'C:\\Users\\justin.farrell\\Documents\\[PROJECT NAME]',
  arch: 'x64',
  platform: 'win32',
  afterFinalizePackageTargets: [ [AsyncFunction (anonymous)] ],
  afterComplete: [ [AsyncFunction (anonymous)] ],
  afterCopy: [ [AsyncFunction (anonymous)] ],
  afterExtract: [ [AsyncFunction (anonymous)] ],
  afterPrune: [ [AsyncFunction (anonymous)] ],
  out: 'C:\\Users\\justin.farrell\\Documents\\[PROJECT NAME]\\out',
  electronVersion: '24.8.5'
} +0ms
  electron-forge:packager targets: [ { platform: 'win32', arch: 'x64' } ] +20ms
[STARTED] Packaging for x64 on win32
[STARTED] Copying files
[FAILED] EPERM: operation not permitted, rmdir 'C:\Users\JUSTIN~1.FAR\AppData\Local\Temp\electron-packager\win32-x64\[PROJECT NAME]-win32-x64-MIJEjn\resources\app\node_modules\.cli-spinners-uvmGTKND'
[FAILED] EPERM: operation not permitted, rmdir 'C:\Users\JUSTIN~1.FAR\AppData\Local\Temp\electron-packager\win32-x64\[PROJECT NAME]-win32-x64-MIJEjn\resources\app\node_modules\.cli-spinners-uvmGTKND'
[FAILED] EPERM: operation not permitted, rmdir 'C:\Users\JUSTIN~1.FAR\AppData\Local\Temp\electron-packager\win32-x64\[PROJECT NAME]-win32-x64-MIJEjn\resources\app\node_modules\.cli-spinners-uvmGTKND'
[FAILED] EPERM: operation not permitted, rmdir 'C:\Users\JUSTIN~1.FAR\AppData\Local\Temp\electron-packager\win32-x64\[PROJECT NAME]-win32-x64-MIJEjn\resources\app\node_modules\.cli-spinners-uvmGTKND'

An unhandled rejection has occurred inside Forge:
Error: EPERM: operation not permitted, rmdir 'C:\Users\JUSTIN~1.FAR\AppData\Local\Temp\electron-packager\win32-x64\[PROJECT NAME]-win32-x64-MIJEjn\resources\app\node_modules\.cli-spinners-uvmGTKND'

forge.config.ts:

module.exports = {
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {},
    },
  ],
};
@justinfarrelldev
Copy link
Author

Hmm, it appears that what was causing this was an empty folder present in my node_modules titled ".cli-spinners-uvmGTKND". Once I deleted that, curiously it worked.

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

No branches or pull requests

1 participant