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

constructing module path with incorrect version #3037

Closed
bretg opened this issue Jan 31, 2015 · 7 comments
Closed

constructing module path with incorrect version #3037

bretg opened this issue Jan 31, 2015 · 7 comments
Labels

Comments

@bretg
Copy link

bretg commented Jan 31, 2015

Having an issue with node-webkit finding a C/C++ module in a scenario similar to one resolved last fall for sqlite3 in TryGhost/node-sqlite3#328, except I’m working with serialport.

OSX 10.9.5
node 0.10.35
node-webkit 0.8.6
node-pre-gyp 0.6.2
serialport 1.4.10

sudo node-pre-gyp rebuild --runtime=node-webkit --target=0.8.6 --target_arch=ia32
node-pre-gyp builds serialport nicely and puts it in:
/usr/local/lib/node_modules/serialport/build/serialport/v1.4.10/Release/node-webkit-v0.8.6-darwin-ia32/serialport.node

But node-webkit looks for it as ‘v11’ instead of ‘v0.8.6’:

"Uncaught Error: Cannot find module '/usr/local/lib/node_modules/serialport/build/serialport/v1.4.10/Release/node-webkit-v11-darwin-ia32/serialport.node'", source: module.js (343)

The module works if I add the appropriate symlink.

Got similar results trying node 0.11.13 with node-webkit 0.11.6, except the error was
"Uncaught Error: Cannot find module ‘[…]/node-webkit-v14-darwin-x64/serialport.node'", source: module.js (343). It would have succeeded had it looked in […]/node-webkit-v0.11.6-darwin-x64/serialport.node

Spent a couple evenings reading various threads and tried a number of approaches. Happened to notice serialport comes bundled with 0.5.9 version of node-pre-gyp, but upgrading that didn’t help. Tried a recursive grep in several trees to see where the ‘v11’ js coming from… not seeing it.

Appreciate any insight into how node-webkit constructs the module path. i.e. why it’s choosing v11 (or v14). In the meantime, the symlink works ok.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@RIAEvangelist
Copy link

There is a lot of trouble with serial port, if you search the closed bug list you'll find a lot of info.

So much trouble in fact that I am building a pure JS implementation for serial coms.

@bretg
Copy link
Author

bretg commented Feb 7, 2015

Thanks RIAEvangelist, though the specific issue I'm having seems to be more just path related -- serial port functionality is ok with the limited testing I've done so far after the symlink made it work.

Still interested if anyone can shed light on how node-webkit constructs the module path -- i.e. where's it getting that "v11"?

In any case, will keep an eye out for your JS implementation.

@endorama
Copy link

endorama commented Feb 9, 2015

Hello everyone, I'm having the same issue @bretg is having.

After a bit of struggle I was able to compile node-serialport with node-pre-gyp, but the compilation produces the folder build/serialport/v1.4.10/Release/node-webkit-v0.11.5-linux-x64 while node-webkit seems to need the folder build/serialport/v1.4.10/Release/node-webkit-v14-linux-x64

I've copied the folder naming it as required and everything is working fine, but this is a bit of a problem when others have to npm install the project dependencies.

I'm on Ubuntu 14.04, x86_64.
Node webkit is 0.11.5 ( I've tried with no luck the 0.12.0-alpha2 relase )

Thanks in advance for the help provided!

@RIAEvangelist
Copy link

@bretg
Copy link
Author

bretg commented Feb 23, 2015

Nice progress - checked it out and generally like the interface. Would like
to be able to get port info like the other serial port module does.
e.g. port.manufacturer.

Not working for me in Ubuntu (14.10) and of course not on Mac.

FWIW, here's the paths to my serial ports:

Ubuntu: /dev/ttyACM0
Mac: /dev/cu.usbmodem1421

Watching the repository -- happy to help test.

On Sat, Feb 14, 2015 at 3:14 AM, Brandon Nozaki Miller <
notifications@github.com> wrote:

@bretg https://github.com/bretg check it out here :
https://github.com/RIAEvangelist/serialport-js


Reply to this email directly or view it on GitHub
#3037 (comment).

@RIAEvangelist
Copy link

Thanks for the info!

@stale
Copy link

stale bot commented Oct 4, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 4, 2017
@stale stale bot closed this as completed Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants