electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.66k stars 1.74k forks source link

EPERM When compile on Windows #2800

Closed ander7agar closed 5 years ago

ander7agar commented 6 years ago
  • electron-builder version=20.8.2
  • Specified application directory equals to project dir — superfluous or wrong configuration appDirectory=./
  • Unresolved node modules: chai
  • rebuilding native production dependencies platform=win32 arch=x64

Error: C:\Program Files\nodejs\node.exe exited with code 1
Error output:
gyp ERR! clean error
gyp ERR! stack Error: EPERM: operation not permitted, unlink 'C:\Users\MyUser\my-electron-app\node_modules\better-sqlite3\build\Release\better_sqlite3.nod
e'
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\MyUser\my-electron-app\node_modules\better-sqlite3
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Error: exit code 1
    at ChildProcess.<anonymous> (C:\Users\MyUser\my-electron-app\node_modu
les\lzz-gyp\lib\exec.js:19:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@4.1.0 install: `node deps/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@4.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MyUser\AppData\Roaming\npm-cache\_logs\2018-04-17T10_59_09_
702Z-debug.log

    at ChildProcess.<anonymous> (C:\Users\MyUser\my-electron-app\node_modu
les\lzz-gyp\lib\exec.js:19:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
    at ChildProcess.childProcess.once.code (C:\Users\MyUser\my-electron-app\node_modules\builder-util\src\util.ts:251:14)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)
From previous event:
    at rebuild (C:\Users\MyUser\my-electron-app\node_modules\electron-buil
der-lib\out\util\yarn.js:233:18)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\util\yarn.ts:20:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at installOrRebuild (C:\Users\MyUser\my-electron-app\node_modules\elec
tron-builder-lib\out\util\yarn.js:68:17)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:450:7
    at Generator.next (<anonymous>)
From previous event:
    at Packager.installAppDependencies (C:\Users\MyUser\my-electron-app\no
de_modules\electron-builder-lib\out\packager.js:695:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:364:20
    at Generator.next (<anonymous>)
From previous event:
    at Packager.doBuild (C:\Users\MyUser\my-electron-app\node_modules\elec
tron-builder-lib\out\packager.js:605:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:316:52
From previous event:
    at Packager._build (C:\Users\MyUser\my-electron-app\node_modules\elect
ron-builder-lib\out\packager.js:532:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:289:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Packager.build (C:\Users\MyUser\my-electron-app\node_modules\electr
on-builder-lib\out\packager.js:491:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\index.ts:51:40
    at Generator.next (<anonymous>)
From previous event:
    at build (C:\Users\MyUser\my-electron-app\node_modules\electron-builde
r-lib\out\index.js:220:17)
    at Object.build (C:\Users\MyUser\my-electron-app\node_modules\electron
-builder\src\builder.ts:229:10)
    at build (C:\Users\MyUser\my-electron-app\build\compile.js:44:13)
    at compileWin (C:\Users\MyUser\my-electron-app\build\compile.js:83:5)
    at compile (C:\Users\MyUser\my-electron-app\build\compile.js:116:12)
    at C:\Users\MyUser\my-electron-app\build\compile.js:173:49
    at tryCallOne (C:\Users\MyUser\my-electron-app\node_modules\nodegit-pr
omise\lib\core.js:37:12)
    at C:\Users\MyUser\my-electron-app\node_modules\nodegit-promise\lib\co
re.js:103:15
    at flush (C:\Users\MyUser\my-electron-app\node_modules\asap\raw.js:50:
29)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Compilation error Error: C:\Program Files\nodejs\node.exe exited with code 1
Error output:
gyp ERR! clean error
gyp ERR! stack Error: EPERM: operation not permitted, unlink 'C:\Users\MyUser\my-electron-app\node_modules\better-sqlite3\build\Release\better_sqlite3.nod
e'
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\MyUser\my-electron-app\node_modules\better-sqlite3
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Error: exit code 1
    at ChildProcess.<anonymous> (C:\Users\MyUser\my-electron-app\node_modu
les\lzz-gyp\lib\exec.js:19:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@4.1.0 install: `node deps/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@4.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MyUser\AppData\Roaming\npm-cache\_logs\2018-04-17T10_59_59_
610Z-debug.log

    at ChildProcess.<anonymous> (C:\Users\MyUser\my-electron-app\node_modu
les\lzz-gyp\lib\exec.js:19:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
    at ChildProcess.childProcess.once.code (C:\Users\MyUser\my-electron-app\node_modules\builder-util\src\util.ts:251:14)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)
From previous event:
    at rebuild (C:\Users\MyUser\my-electron-app\node_modules\electron-buil
der-lib\out\util\yarn.js:233:18)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\util\yarn.ts:20:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at installOrRebuild (C:\Users\MyUser\my-electron-app\node_modules\elec
tron-builder-lib\out\util\yarn.js:68:17)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:450:7
    at Generator.next (<anonymous>)
From previous event:
    at Packager.installAppDependencies (C:\Users\MyUser\my-electron-app\no
de_modules\electron-builder-lib\out\packager.js:695:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:364:20
    at Generator.next (<anonymous>)
From previous event:
    at Packager.doBuild (C:\Users\MyUser\my-electron-app\node_modules\elec
tron-builder-lib\out\packager.js:605:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:316:52
From previous event:
    at Packager._build (C:\Users\MyUser\my-electron-app\node_modules\elect
ron-builder-lib\out\packager.js:532:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\packager.ts:289:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Packager.build (C:\Users\MyUser\my-electron-app\node_modules\electr
on-builder-lib\out\packager.js:491:7)
    at C:\Users\MyUser\my-electron-app\node_modules\electron-builder-lib\s
rc\index.ts:51:40
    at Generator.next (<anonymous>)
From previous event:
    at build (C:\Users\MyUser\my-electron-app\node_modules\electron-builde
r-lib\out\index.js:220:17)
    at Object.build (C:\Users\MyUser\my-electron-app\node_modules\electron
-builder\src\builder.ts:229:10)
    at build (C:\Users\MyUser\my-electron-app\build\compile.js:44:13)
    at compileWin (C:\Users\MyUser\my-electron-app\build\compile.js:83:5)
    at compile (C:\Users\MyUser\my-electron-app\build\compile.js:116:12)
    at C:\Users\MyUser\my-electron-app\build\compile.js:173:49
    at tryCallOne (C:\Users\MyUser\my-electron-app\node_modules\nodegit-pr
omise\lib\core.js:37:12)
    at C:\Users\MyUser\my-electron-app\node_modules\nodegit-promise\lib\co
re.js:103:15
    at flush (C:\Users\MyUser\my-electron-app\node_modules\asap\raw.js:50:
29)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

I tried using electron-rebuild, but it does not solve anything. Another curious fact is that if I use the electron-builder install-app-deps or electron-builder build -w --x64 it blocks in rebuilding native production dependencies ... and never ends.

In case it is necessary these are the versions:

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

snake-py commented 3 years ago

Hey could you resolve the issue. I am having the same problem. I am not sure if it comes from better-sqlite3

 ⨯ cannot execute  cause=exit status 1
                    out=
    > better-sqlite3@7.1.1 install C:\Users\vabis\Desktop\Playground\projects\project-app\node_modules\better-sqlite3
    > prebuild-install || npm run build-release

    > better-sqlite3@7.1.1 build-release C:\Users\vabis\Desktop\Playground\projects\project-app\node_modules\better-sqlite3
    > node-gyp rebuild --release

    C:\Users\vabis\Desktop\Playground\projects\project-app\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )      

                    errorOut=prebuild-install WARN install No prebuilt binaries found (target=10.1.5 runtime=electron arch=x64 libc= platform=win32)
    gyp ERR! clean error
    gyp ERR! stack Error: EPERM: operation not permitted, unlink 'C:\Users\vabis\Desktop\Playground\projects\project-app\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
    gyp ERR! System Windows_NT 10.0.19041
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
    gyp ERR! cwd C:\Users\vabis\Desktop\Playground\projects\project-app\node_modules\better-sqlite3
    gyp ERR! node -v v12.16.1
    gyp ERR! node-gyp -v v5.0.5
    gyp ERR! not ok
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! better-sqlite3@7.1.1 build-release: `node-gyp rebuild --release`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the better-sqlite3@7.1.1 build-release script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\vabis\AppData\Roaming\npm-cache\_logs\2021-01-03T19_30_31_413Z-debug.log
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! better-sqlite3@7.1.1 install: `prebuild-install || npm run build-release`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the better-sqlite3@7.1.1 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\vabis\AppData\Roaming\npm-cache\_logs\2021-01-03T19_30_31_429Z-debug.log

                    command='C:\Program Files\nodejs\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' rebuild better-sqlite3@7.1.1 node-sass@4.14.1
                    workingDir=