question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not do anything

See original GitHub issue

I am having a hard time understanding what this really do. Here is my gulp script

// Rebuilds native node modules for Electron.
// More: https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md

'use strict';

var path = require('path');
var Q = require('q');
var electron = require('electron-prebuilt');
var electronPackage = require('electron-prebuilt/package.json');
var rebuild = require('electron-rebuild');
const UTILS = require('./utils');
const PATHS = UTILS.PATHS;

var pathToElectronNativeModules = path.join(__dirname, '..', PATHS.APP, 'node_modules');

rebuild.shouldRebuildNativeModules(electron)
.then(function (shouldBuild) {
    if (!shouldBuild) {
        return true;
    }

    console.log('Rebuilding native modules for Electron at ', pathToElectronNativeModules, '...');

    console.log('installNodeHeaders');
    return rebuild.installNodeHeaders(electronPackage.version)
    .then(function () {
        console.log('rebuildNativeModules');
        return rebuild.rebuildNativeModules(electronPackage.version, pathToElectronNativeModules);
    }).then(function () {
        console.log('preGypFixRun');
        return rebuild.preGypFixRun(pathToElectronNativeModules, true , electron);
    });
})
.then(function () {
    console.log('Rebuilding complete.');
})
.catch(function (err) {
    console.error("Rebuilding error!");
    console.error(err);
});

Now i have a few native modules, some using node-pre-gyp and some not Isn’t electron-rebuild suppose to go into each native module dir and call something like

node-gyp rebuild --target=1.2.0 --arch=x64 --dist-url=https://atom.io/download/atom-shell

or

node-pre-gyp rebuild --target=1.2.0 --arch=x64 --dist-url=https://atom.io/download/atom-shell

For me it does not do anything and simply says

Rebuilding complete.

While my modules are not compiled. I have to do it by hand

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
developercurtnicholascommented, Jun 22, 2019

Electron will not find the module to recompile it if it was installed as a devDependency.

So:

  1. In your package.json move the module you want to recompile from the devDependecies section to the dependencies section.
  2. Then run npm install.
  3. Then run .\node_modules.bin\electron-rebuild.cmd or ./node_modules/.bin/electron-rebuild

If you have problems with step 3 visit https://electronjs.org/docs/tutorial/using-native-node-modules and ensure that electron-rebuild is installed.

If it complains about python then run: npm install --global --production windows-build-tools

Thumbs up so others can see.

8reactions
MarshallOfSoundcommented, Jan 4, 2017

The new version of electron-rebuild should fix these issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"it does nothing" vs "it doesn't do anything"
Both mean the same but for clarity I'd use "it does nothing" because it is simpler.
Read more >
What is the difference between doing nothing and not ... - Quora
“Doing nothing” is a conscious choice; “not doing anything” is a lack of conscious choice to do something. The mind needs rest. The...
Read more >
Doesn't do anything for - Idioms by The Free Dictionary
(informal) used to say that something does not make somebody look attractive: That hairstyle doesn't do anything for her. See also: anything, for,...
Read more >
“I didn't do nothing” or “I didn't do anything”? Which is correct?
When you have a negative sentence(did not in this case), you need to use “anything”. “Nothing” is a word that you can use...
Read more >
to not act or to not do something - synonyms and related words
Synonyms · bother · abstain · neglect · refrain · let nature take its course · make no move · can't bring yourself...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found