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

cannot find module '../native/noble_mac' #37

Open
slayer1021 opened this issue Sep 22, 2019 · 6 comments
Open

cannot find module '../native/noble_mac' #37

slayer1021 opened this issue Sep 22, 2019 · 6 comments

Comments

@slayer1021
Copy link

Followed instructions for installation but keep getting the error cannot find module '../native/noble_mac' , did check the location and no file exists in the location.

@kenken64
Copy link

Error: Cannot find module '../native/noble_mac'

@geovie
Copy link
Collaborator

geovie commented Dec 20, 2019

@slayer1021 @kenken64 Which node version are you using? How are you installing noble-mac?
You might want to take a look at abandonware/noble which has the bindings of this repo integrated.

@blamay
Copy link

blamay commented Apr 12, 2021

I experienced this issue on both this repo & on abandonware/noble, and it was because I am using webpack which doesn't play nicely with the binding.node file, or in this repos case, the noble_mac.node file. I was able to fix it by forking the repo and using https://github.com/webpack-contrib/node-loader in binding.js

const NobleMac = require('node-loader!./native/binding.node').NobleMac;

I think there could potentially be a change to allow you to use node-loader in your project and pass the binding along as an option which starting noble.

@geovie
Copy link
Collaborator

geovie commented Apr 13, 2021

@blamay Could you specify noble-mac as external in webpack, then it should work...

@blamay
Copy link

blamay commented May 4, 2021

Specifying noble (or in my case, @abandonware/noble) as external does fix this problem for me.

@ajjimsa
Copy link

ajjimsa commented Nov 23, 2022

@blamay Possibly you don't have added in webpack file to load the .node extensions.
...
resolve: {
extensions: [".js", ".css",".node","..."],
},
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants