Since version 18.7.0, when installing electron-builder with npm, I get an error with fcopy-pre-bundled:
> [email protected] install /testproject/node_modules/fcopy-pre-bundled
> node-gyp rebuild
gyp: binding.gyp not found (cwd: /testproject/node_modules/fcopy-pre-bundled) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-79-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /testproject/node_modules/fcopy-pre-bundled
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@^2.1.0 (node_modules/7zip-bin/node_modules/7zip-bin-win):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@^1.0.1 (node_modules/7zip-bin/node_modules/7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/testproject/package.json'
npm WARN toto No description
npm WARN toto No repository field.
npm WARN toto No README data
npm WARN toto No license field.
npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "electron-builder"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fcopy-pre-bundled package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fcopy-pre-bundled
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls fcopy-pre-bundled
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /testproject/npm-debug.log
node version: v6.11.0
npm version: 3.10.10
fcopy-pre-bundled doesn't have install task. Hmm... Does it work using yarn?
We're running into an issue on node 6, using npm i (switching off of yarn in favor of npm@5) with fcopy-pre-bundled. Yesterday this was building on node 6 just fine (on Travis).
Yarn outperforms npm 5 also, someday electron-builder will even print warn if npm used.
Could you please try 19.1.0?
Will do, thanks!
"broken" version was marked as release today but no such reports during next testing. I have reverted tag latest to 18.6.2
Anyway, I think will be no error if you use reliable yarn instead of buggy npm. In the 19.1.0 some changes done to make npm happy. Please verify.
If yarn or 19.2.2 version of electron-builder helps you — please comment here. To be sure that this bug or fixed, or NPM sucks.
It's working with yarn but still failing with npm with 19.1.0 and 19.2.2.
Sadly, we cannot yet drop support of buggy and unreliable NPM. I will try to make npm happy. @osechet Thanks for verification.
I cannot reproduce npm failure. node 8.1.1 & npm 5.
Please try 19.2.5 If NPM still failed, please specify node version and npm version.
I cannot test right now but as mentioned in the issue I'm using the LTS version of node:
node version: v6.11.0
npm version: 3.10.10
I had the same issue, going to 19.2.5 worked flawlessly. Thank you @develar for this (and I must agree with you on npm, it's in the game for the worst thing that could've ever happened to web frontend development).
node version: v6.10.3
npm version: 3.10.10
With the help of my friend, I fixed the same issue.
rm -rf node_modules/fcopy-pre-bundled
npm i fcopy-pre-bundled
there is another issue: Electron failed to install correctly, please delete node_modules/electron and try installing again.
rm -rf node_modules/electron
npm i electron
fixed.
@espring Please stop wasting your time. Get rid of NPM and consider to use Yarn.
Thanks! It works with Yarn.
Most helpful comment
I cannot test right now but as mentioned in the issue I'm using the LTS version of node:
node version: v6.11.0
npm version: 3.10.10