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

can't install serialport lib #2249

Closed
tadjik1 opened this issue Aug 26, 2014 · 2 comments
Closed

can't install serialport lib #2249

tadjik1 opened this issue Aug 26, 2014 · 2 comments

Comments

@tadjik1
Copy link

tadjik1 commented Aug 26, 2014

Hello.

I try to create a simple app with node-webkit. I run yeoman-generator for my project. Then I run npm install --save serialport

I wrote simple app

'use strict';

var serialPort = require('serialport');
serialPort.list(function (err, ports) {
    ports.forEach(function(port) {
        console.log(port.comName);
        console.log(port.pnpId);
        console.log(port.manufacturer);
    });
});

then I run grunt task - dist-mac (I use MacOS 64-bit) - all works fine:

Running "jshint:files" (jshint) task
>> 1 file lint free.

Running "clean:dist" (clean) task
Cleaning dist/.DS_Store...OK
Cleaning dist/credits.html...OK
Cleaning dist/nwsnapshot...OK
Cleaning dist/test.app...OK

Running "copy:webkit" (copy) task
Created 37 directories, copied 99 files

Running "copy:appMacos" (copy) task
Created 5 directories, copied 5 files

Running "rename:app" (rename) task
Renaming Directory dist/node-webkit.app -> dist/test.app

Running "chmod" task

Done, without errors.


Execution Time (2014-08-26 14:23:21 UTC)
loading tasks  410ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 50%
jshint:files    27ms  ▇▇ 3%
clean:dist      30ms  ▇▇ 4%
copy:webkit    336ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 41%
copy:appMacos   14ms  ▇ 2%
Total 820ms

and then, when I launch my application I see the error

Error: Cannot find module '/Users/user/projects/test/node_modules/serialport/build/serialport/v1.4.5/Release/node-webkit-v13-darwin-ia32/serialport.node'

And into folder Release I see the other folder named node-v11-darwin-x64. Why it doesn't work?

@Mithgol
Copy link
Contributor

Mithgol commented Aug 31, 2014

Probably you get the folder node-v11-darwin-x64 instead of node-webkit-v13-darwin-ia32 because npm install --save serialport gets that addon for Node.js and not for node-webkit.

See also https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules#3rd-party-modules-with-cc-addons and #2262 and serialport/node-serialport#374.

@tadjik1
Copy link
Author

tadjik1 commented Aug 31, 2014

The issue was resolved. You can find solution under the following link serialport/node-serialport#374

@tadjik1 tadjik1 closed this as completed Aug 31, 2014
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

2 participants