electron forge make --- operation not permitted

32 Views Asked by At

I'm developing a desktop application with react-vite + electron.

Everything was working fine, but at a certain point the "npm run make" command (which had worked correctly up to that point) started to stop working and reports the error: EPERM: operation not permitted, rmdir ...

basically the "make" command creates a temporary folder but then fails to delete it I tried everything to fix, but nothing worked:

  • run as administrator
  • delete the ".vccode" folder in the "C:\users\User" folder
  • delete the folder "C:\Users\User\AppData\Local\Temp\electron-packager..."
  • close all vscode tabs
  • launch the command from the command prompt (instead of vsCode)
  • close and reopen vsCode
  • turn the PC off and on again
  • install "FusesPlugin"
  • reinstall all modules
  • run the command "npm cache clean --force"
  • restarting the vscode terminal
  • run the command "npm install -g npm@latest"

other notes:

  • I don't think I have any active server (127.0.0.1 and localhost don't work)
  • no file in the folder that cannot be deleted is in use by any application, also because they are files created by the "make" command my version of vscode is up to date

I've tried all the solutions I've found regarding this problem but I still haven't been able to figure it out, have I forgotten something?

VSCODE TERMINAL

PS C:\sorgenti\bullet_hell> npm run make

> [email protected] make
> electron-forge make   

✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
  › Making for the following targets:
❯ Running package command
  ✔ Preparing to package application
  ✔ Running packaging hooks
    ✔ Running generateAssets hook
    ✔ Running prePackage hook
  ❯ Packaging application
    ❯ Packaging for x64 on win32
      ✖ Copying files
        › EPERM: operation not permitted, rmdir 'C:\Users\Utente\AppData\Local\Temp\electron-packager\tmp-41TiX8\resources\app'
      ◼ Preparing native dependencies
      ◼ Finalizing package
  ◼ Running postPackage hook
◼ Running preMake hook
◼ Making distributables
◼ Running postMake hook

An unhandled rejection has occurred inside Forge:
Error: EPERM: operation not permitted, rmdir 'C:\Users\Utente\AppData\Local\Temp\electron-packager\tmp-41TiX8\resources\app'

DEPENDENCIES

  "dependencies": {
    "@electron-toolkit/preload": "^2.0.0",
    "@electron-toolkit/utils": "^2.0.0",
    "electron-squirrel-startup": "^1.0.0",
    "electron-updater": "^6.1.1"
  },
  "devDependencies": {
    "@electron-forge/cli": "^7.3.1",
    "@electron-forge/maker-deb": "^7.3.1",
    "@electron-forge/maker-rpm": "^7.3.1",
    "@electron-forge/maker-squirrel": "^7.3.1",
    "@electron-forge/maker-zip": "^7.3.1",
    "@electron-forge/plugin-auto-unpack-natives": "^7.3.1",
    "@electron-forge/plugin-fuses": "^7.3.1",
    "@electron-toolkit/eslint-config-prettier": "^1.0.1",
    "@electron-toolkit/eslint-config-ts": "^1.0.0",
    "@electron-toolkit/tsconfig": "^1.0.1",
    "@electron/fuses": "^1.7.0",
    "@types/node": "^18.17.5",
    "@types/react": "^18.2.20",
    "@types/react-dom": "^18.2.7",
    "@vitejs/plugin-react": "^4.0.4",
    "electron": "^25.6.0",
    "electron-vite": "^1.0.29",
    "eslint": "^8.47.0",
    "eslint-plugin-react": "^7.33.2",
    "prettier": "^3.0.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "typescript": "^5.1.6",
    "vite": "^4.4.9"
  }

SCRIPTS

  • npm run dev --- work
  • npm run build --- work
  • npm run make --- don't work !
  • npm run prebuild --- work
  • npm start --- work
  "scripts": {
    "dev": "electron-vite dev",
    "build": "npm run typecheck && electron-vite build",
    "make": "electron-forge make",
    "prebuild": "electron-vite build",
    "start": "electron-forge start",
    "format": "prettier --write .",
    "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
    "typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
    "typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
    "typecheck": "npm run typecheck:node && npm run typecheck:web",
    "postinstall": "electron-builder install-app-deps",
    "build:win": "npm run build && electron-builder --win --config",
    "build:mac": "electron-vite build && electron-builder --mac --config",
    "build:linux": "electron-vite build && electron-builder --linux --config",
    "package": "electron-forge package"
  },
0

There are 0 best solutions below