pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.3k stars 138 forks source link

Hydrogen fails to activate: No native build was found for ... #359

Open humanplayer2 opened 1 year ago

humanplayer2 commented 1 year ago

Thanks in advance for your bug report!

What happened?

Hydrogen package fails to activate with the following error:

Failed to activate the Hydrogen package

No native build was found for platform=linux arch=x64 runtime=electron abi=87 uv=1 libc=glibc node=14.16.0 electron=12.2.3
    loaded from: /home/username/.pulsar/packages/Hydrogen/node_modules/zeromq
Hide Stack Trace
Error: No native build was found for platform=linux arch=x64 runtime=electron abi=87 uv=1 libc=glibc node=14.16.0 electron=12.2.3
    loaded from: /home/username/.pulsar/packages/Hydrogen/node_modules/zeromq
    at Function.load.resolve.load.path (/home/username/.pulsar/packages/Hydrogen/node_modules/node-gyp-build/node-gyp-build.js:60:9)
    at load (/home/username/.pulsar/packages/Hydrogen/node_modules/node-gyp-build/node-gyp-build.js:22:30)
    at Object.<anonymous> (/home/username/.pulsar/packages/Hydrogen/node_modules/zeromq/binding.js:1:198)
    at Object.<anonymous> (/home/username/.pulsar/packages/Hydrogen/node_modules/zeromq/binding.js:3:3)
    at Module._compile (/opt/Pulsar/resources/app.asar/src/native-compile-cache.js:120:30)
    at Object.value [as .js] (/opt/Pulsar/resources/app.asar/src/compile-cache.js:252:23)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.o._load (electron/js2c/renderer_init.js:33:379)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (/opt/Pulsar/resources/app.asar/src/native-compile-cache.js:67:27)
    at Object.<anonymous> (/home/username/.pulsar/packages/Hydrogen/node_modules/zeromq/lib/index.js:6:11)
    at Object.<anonymous> (/home/username/.pulsar/packages/Hydrogen/node_modules/zeromq/lib/index.js:857:3)
    at Module._compile (/opt/Pulsar/resources/app.asar/src/native-compile-cache.js:120:30)
    at Object.value [as .js] (/opt/Pulsar/resources/app.asar/src/compile-cache.js:252:23)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.o._load (electron/js2c/renderer_init.js:33:379)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (/opt/Pulsar/resources/app.asar/src/native-compile-cache.js:67:27)
    at Object.<anonymous> (/home/username/.pulsar/packages/Hydrogen/node_modules/zeromq/index.js:2:18)
    at Object.<anonymous> (/home/username/.pulsar/packages/Hydrogen/node_modules/zeromq/index.js:3:3)
    at Module._compile (/opt/Pulsar/resources/app.asar/src/native-compile-cache.js:120:30)
    at Object.value [as .js] (/opt/Pulsar/resources/app.asar/src/compile-cache.js:252:23)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.o._load (electron/js2c/renderer_init.js:33:379)

Pulsar version

1.101.0-beta

Which OS does this happen on?

🐧 Debian based (Linux Mint, Ubuntu, etc.)

OS details

Pop!_OS 22.04

Which CPU architecture are you running this on?

None

What steps are needed to reproduce this?

  1. Install the most recent release of Hydrogen: pulsar -p install https://github.com/nteract/hydrogen/ -b v2.16.5
  2. Rebuild because someone suggested so: pulsar -p rebuild
  3. Open Pulsar, choose "Start Local Kernel" in command palette.

Additional Information:

I have Hydrogen working in Atom. It requires ipykernel:

python3 -m pip install ipykernel
python3 -m ipykernel install --user
savetheclocktower commented 1 year ago

I answered you on Reddit, but for posterity, the fix is this:

cd ~/.pulsar/packages/hydrogen  # or the equivalent on windows
npx electron-rebuild -v 12.2.3

Then relaunch Pulsar or run Window: Reload.

If this fixes it for you, let me know, and we can close this bug.

humanplayer2 commented 1 year ago

Thank you! Issue solved -- Pulsar conversion achieved!

On Pop!_OS 22.04, the full list of things I did was:

sudo apt install nodejs npm 
sudo npm install --global npm
cd $HOME/.pulsar/packages/hydrogen-2.16.5/
npx electron-rebuild -v 12.2.3
rchaklashiya commented 1 year ago

In case this is of any importance, I had the same issue on Windows and this solved the problem there too!

mauricioszabo commented 1 year ago

Technically, this is still a bug - Pulsar should be able to do these steps for you.

I'm going to reopen this, until we 100% fix it one could use this workaround

savetheclocktower commented 1 year ago

Technically, this is still a bug - Pulsar should be able to do these steps for you.

Yeah, that's fair. After this discussion I wondered why this wasn't happening automatically, because surely any native module would need to be compiled for the given platform and Electron version if a package author added it as a dependency. But I don't know anything about the machinery of how that happens.

shr00mie commented 1 year ago

I answered you on Reddit, but for posterity, the fix is this:

cd ~/.pulsar/packages/hydrogen  # or the equivalent on windows
npx electron-rebuild -v 12.2.3

Then relaunch Pulsar or run Window: Reload.

If this fixes it for you, let me know, and we can close this bug.

i love you long time.

chriskuchar commented 1 year ago

I have been sitting here using atom + hydrogen past the sunset, waiting and hoping for something like this to come along. You guys are the reason why open source is awesome.

Lithobius commented 1 year ago

I answered you on Reddit, but for posterity, the fix is this:

cd ~/.pulsar/packages/hydrogen  # or the equivalent on windows
npx electron-rebuild -v 12.2.3

Then relaunch Pulsar or run Window: Reload.

If this fixes it for you, let me know, and we can close this bug.

this worked today on OSX 13.3.1 also resolving this issue for me: https://github.com/Spiker985/x-terminal-reloaded/issues/27

Thank you so much

ReneTC commented 1 year ago

Wondering if I can get some input. When I execute:

cd ~/.pulsar/packages/hydrogen
npx electron-rebuild -v 12.2.3

I get:

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/user/reth/.pulsar/packages/hydrogen/node_modules/zeromq'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `make` failed with exit code: 2

Anyone knows how to continue?

savetheclocktower commented 1 year ago

I'd follow the directions and run

DEBUG=electron-rebuild npx electron-rebuild -v 12.2.3

and see if it produces any useful output.

ReneTC commented 1 year ago

Thanks. I haven't been able to resolve this yet. Any ideas are welcome:

>>> sudo DEBUG=electron-rebuild npx electron-rebuild -v 12.2.3
Error: node-gyp failed to rebuild '/user/reth/.pulsar/packages/hydrogen/node_modules/zeromq'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `make` failed with exit code: 2

    at NodeGyp.rebuildModule (/root/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/module-type/node-gyp.js:120:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ModuleRebuilder.rebuildNodeGypModule (/root/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/module-rebuilder.js:98:9)
    at async ModuleRebuilder.rebuild (/root/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/module-rebuilder.js:128:14)
    at async Rebuilder.rebuildModuleAt (/root/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/rebuild.js:149:13)
    at async Rebuilder.rebuild (/root/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/rebuild.js:112:17)
    at async /root/.npm/_npx/c78fbb4f3949be78/node_modules/electron-rebuild/lib/src/cli.js:158:9
weiji14 commented 9 months ago

Finally got Hydrogen to install on Pulsar 1.112.1 in my Linux machine after more than a year stuck on Atom :sob: In my case, I had to cd ~/.pulsar/packages/Hydrogen/ (with a capital H), and then run the electron-rebuild command. This blog post has step by step instructions - https://pipegalera.com/posts/pulsar-hydrogen which might be clearer to follow.