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

Rebuilding native modules directory naming issue #33

Closed
oransel opened this issue Oct 28, 2015 · 9 comments
Closed

Rebuilding native modules directory naming issue #33

oransel opened this issue Oct 28, 2015 · 9 comments

Comments

@oransel
Copy link

@oransel oransel commented Oct 28, 2015

When rebuilding with the serialport module, it names the final directory as

electron-v0.34.1-darwin-x64

However, when ran with the executable, it is looking for

node-v46-darwin-x64

It seems like in main.js, the directory name and electron versioning is mixed.

@anaisbetts
Copy link
Contributor

@anaisbetts anaisbetts commented Oct 28, 2015

Nothing we can do about this, file on serialport?

@anaisbetts anaisbetts closed this Oct 28, 2015
@oransel
Copy link
Author

@oransel oransel commented Oct 28, 2015

how come it is about the serialport module? doesn't electron-rebuild create the output directory?

@anaisbetts
Copy link
Contributor

@anaisbetts anaisbetts commented Oct 28, 2015

Nope

@oransel
Copy link
Author

@oransel oransel commented Oct 28, 2015

As you can see, from npm it names the directory correctly. However, when ran with electron-rebuild, the directory name changes.

from npm:
from-npm

from electron-rebuild:
from-electron-rebuild

@anaisbetts
Copy link
Contributor

@anaisbetts anaisbetts commented Oct 28, 2015

electron-rebuild just asks node-gyp to build your project. As I said again, serialport controls this

@BafS
Copy link

@BafS BafS commented Dec 21, 2015

I have exactly the same problem with sqlite3.

For information:
After having installed sqlite and electron-rebuild I did : ./node_modules/.bin/electron-rebuild and it created a .node file at node_modules/sqlite3/lib/binding/electron-v0.36-darwin-x64/node_sqlite3.node. But electron give this error "Uncaught Error: Cannot find module '/Users/me/dev/proj/node_modules/sqlite3/lib/binding/node-v47-darwin-x64/node_sqlite3.node'"

I renamed the folder to node-v47-darwin-x64 and it worked.

Note that in node_modules/sqlite3/build/config.gypi I have the right path

...
"module_path": "../lib/binding/node-v47-darwin-x64",
...

and node_modules/sqlite3/package.json

...
  "binary": {
    "module_name": "node_sqlite3",
    "module_path": "./lib/binding/{node_abi}-{platform}-{arch}",
    "host": "https://mapbox-node-binary.s3.amazonaws.com",
    "remote_path": "./{name}/v{version}/{toolset}/",
    "package_name": "{node_abi}-{platform}-{arch}.tar.gz"
  },
...

PS: This command work (because module_path hard coded): cd node_modules/sqlite3 && node-gyp rebuild --target=0.36.1 --arch=x64 --target_platform=darwin --runtime=electron --module_name=node_sqlite3 --module_path=../lib/binding/node-v47-darwin-x64

@Malgalad
Copy link

@Malgalad Malgalad commented Jan 21, 2016

Had the same issue, resolution: mapbox/node-pre-gyp#189 (comment)

@barbalex
Copy link

@barbalex barbalex commented Mar 29, 2016

same problem here, only the resolution is none as the pull request is being ignored

@springmeyer
Copy link

@springmeyer springmeyer commented Mar 31, 2016

This is now solved upstream by mapbox/node-pre-gyp#187 - available in node-pre-gyp >= 0.6.25. So, the next step is to ensure that modules you are using that depend and bundle node-pre-gyp get re-tagged with the latest version.

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

Successfully merging a pull request may close this issue.

None yet
6 participants