hyj1991 / v8-profiler-next

node bindings for the v8 profiler
MIT License
219 stars 21 forks source link

Hi, this node can use in Electron? #55

Closed cqmonly closed 2 years ago

cqmonly commented 2 years ago

I want to use [v8-profiler-next] in my electron project, I use npm i v8-profiler-next --build-from-sourc install. When I start my electron application, but get error: Error: Module did not self-register

What do I need to do? Electron Version: 11.4.1 Node Version: v14.19.0 System: Windows 10 x64 Thanks for your help~ Hope to get your advice :)

hyj1991 commented 2 years ago

Since Electron has a different application binary interface (ABI), so you should compile it like:

npm install --save-dev electron-rebuild

# Every time you run "npm install", run this:
./node_modules/.bin/electron-rebuild

# If you have trouble on Windows, try:
.\node_modules\.bin\electron-rebuild.cmd

Reference: https://www.electronjs.org/zh/docs/latest/tutorial/using-native-node-modules

cqmonly commented 2 years ago

thanks, I'll try it

hyj1991 commented 2 years ago

Hello, is there any progress?

amilajack commented 2 years ago

I've confirmed this works