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

classic-level rebuild failed when electron-forge package #84

Closed
rosendolu opened this issue Sep 13, 2023 · 3 comments
Closed

classic-level rebuild failed when electron-forge package #84

rosendolu opened this issue Sep 13, 2023 · 3 comments
Labels
question Support or open question(s)

Comments

@rosendolu
Copy link

problem

I am using level as my local db server ,when pack my electron app ,I got this error and could not fix it .
I tried using a different version of electron ,but still the same

 make: *** No rule to make target `Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o', needed by `Release/leveldb.a'.  Stop.
  Error: `make` failed with exit code: 2
  at ChildProcess.onExit (/Users/neptune/github/xxx/app/node_modules/node-gyp/lib/build.js:203:23)
  at ChildProcess.emit (node:events:513:28)
  at ChildProcess._handle.onexit (node:internal/child_process:291:12)

An unhandled rejection has occurred inside Forge:
Error: node-gyp failed to rebuild '/private/var/folders/v6/51277h6j2258m8yvl9rknkhr0000gp/T/electron-packager/darwin-arm64/nnk-24h-live-darwin-arm64-MeCAK9/Electron.app/Contents/Resources/app/node_modules/classic-level'
at ChildProcess.<anonymous> (/Users/neptune/github/xxx/app/node_modules/@electron/rebuild/lib/module-type/node-gyp/node-gyp.js:118:24)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)

env

node version v18.15.0
electron abi 116
electron version v25.8.1
classic-level 1.3.0

deps

├── @electron-forge/cli@6.4.1
├── @electron-forge/maker-deb@6.4.1
├── @electron-forge/maker-rpm@6.4.1
├── @electron-forge/maker-squirrel@6.4.1
├── @electron-forge/maker-zip@6.4.1
├── @types/node@20.5.1
├── @types/shelljs.exec@1.1.0
├── @types/shelljs@0.8.12
├── @types/ws@8.5.5
├── classic-level@1.3.0
├── dayjs@1.11.9
├── electron-squirrel-startup@1.0.0
├── electron@25.8.1
├── env-cmd@10.1.0
├── fs-extra@11.1.1
├── glob@7.2.3
├── koa-compose@4.1.0
├── log4js@6.9.1
├── make-dir@4.0.0
├── nanoid@4.0.2
├── ncp@2.0.0
├── node-fetch@3.3.2
├── node-machine-id@1.1.12
├── nodemon@3.0.1
├── rimraf@3.0.2
├── shelljs@0.8.5
├── ws@8.13.0
└── xlsx@0.18.5
@vweevers
Copy link
Member

Rebuilding is not necessary, because classic-level includes prebuilt binaries that work for both node and electron. There should be a flag in electron-forge to skip rebuilding, check the docs.

@rosendolu
Copy link
Author

Rebuilding is not necessary, because classic-level includes prebuilt binaries that work for both node and electron. There should be a flag in electron-forge to skip rebuilding, check the docs.

Thanks , after read the docs, I add a conf at forge.config.js

  rebuildConfig: {
    onlyModules: [],
  },

It works.Though occurs another error unrelated to classic-level

@rosendolu
Copy link
Author

After a few tries, I soved the problem;It has nothing wrong about classic-level,instead my forge.config.js;
Before

  packagerConfig: {
    ignore: [/logs/,/temp/,/cache/], // what i set before  
  },

After

  packagerConfig: {
    ignore: [/logs/], // what i set after  
  },

The regular expressions are matched against the absolute path of a given file/directory to be copied..

Awkward,i just ignored the corresponding file !!!

packagerConfig.ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support or open question(s)
Projects
None yet
Development

No branches or pull requests

2 participants