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

Comments

Projects
None yet
6 participants
@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.

@paulcbetts

This comment has been minimized.

Show comment
Hide comment
@paulcbetts

paulcbetts Oct 28, 2015

Collaborator

Nothing we can do about this, file on serialport?

Collaborator

paulcbetts commented Oct 28, 2015

Nothing we can do about this, file on serialport?

@paulcbetts paulcbetts closed this Oct 28, 2015

@oransel

This comment has been minimized.

Show comment
Hide comment
@oransel

oransel Oct 28, 2015

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

oransel commented Oct 28, 2015

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

@paulcbetts

This comment has been minimized.

Show comment
Hide comment
@paulcbetts

paulcbetts Oct 28, 2015

Collaborator

Nope

Collaborator

paulcbetts commented Oct 28, 2015

Nope

@oransel

This comment has been minimized.

Show comment
Hide comment
@oransel

oransel 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

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

@paulcbetts

This comment has been minimized.

Show comment
Hide comment
@paulcbetts

paulcbetts Oct 28, 2015

Collaborator

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

Collaborator

paulcbetts commented Oct 28, 2015

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

@BafS

This comment has been minimized.

Show comment
Hide comment
@BafS

BafS 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

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

This comment has been minimized.

Show comment
Hide comment
@Malgalad

Malgalad Jan 21, 2016

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

Malgalad commented Jan 21, 2016

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

@barbalex

This comment has been minimized.

Show comment
Hide comment
@barbalex

barbalex Mar 29, 2016

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

barbalex commented Mar 29, 2016

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

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer 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.

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