Giter Club home page Giter Club logo

Comments (12)

firrae avatar firrae commented on July 19, 2024 2

@ydubois-fr I dug into the node_modules folder and found each module's .node file that it generated and put it in the root directory beside the generated executable. Note that these .node files are native to the platform they were created on.

from pkg.

firrae avatar firrae commented on July 19, 2024

The error you see with grcp is the same one both Socket.io and bcrypt throw as well. I'm trying to sort out the issue as this is the only blocking one for myself currently.

> Warning Cannot resolve 'binding_path'
  /Users/steven.lambe/iot/node_modules/bcrypt/bcrypt.js
  Use a string literal as argument for 'require', or leave it
  as is and specify the resolved file name in 'scripts' option.
> Warning Cannot resolve 'this.wsEngine'
  /Users/steven.lambe/iot/node_modules/engine.io/lib/server.js
  Use a string literal as argument for 'require', or leave it
  as is and specify the resolved file name in 'scripts' option.

from pkg.

firrae avatar firrae commented on July 19, 2024

To follow up on this, I've tried the following in my package.json file to no success:

"pkg": {
    "scripts": [
        "./node_modules/bcrypt/bcrypt.js",
        "./node_modules/engine.io/lib/server.js"
    ]
  }

In the readme it sounds like this is what is being asked for, but I continue to get the issues after adding them as such. As I stated previously, this is the only blocking issue for my project right now if someone can point out what I am missing.

from pkg.

igorklopov avatar igorklopov commented on July 19, 2024

Please try again with [email protected] but be aware that you must deploy your .node files along with executable. https://github.com/zeit/pkg#native-addons

from pkg.

firrae avatar firrae commented on July 19, 2024

OK, everything works for me now, this is sexy...

from pkg.

ydubois-fr avatar ydubois-fr commented on July 19, 2024

Hi firrae,
can you explain how you resolve your problem ?
Thanks

from pkg.

ydubois-fr avatar ydubois-fr commented on July 19, 2024

@firrae
Thanks for your help.
Sorry, i'm a newbie with node
I have the same problem that you with socket.io :
Warning Cannot resolve 'this.wsEngine'
D:\test\node_modules\engine.io\lib\server.js
Use a string literal as argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.

I copy the file "server.js" beside the generated executable.....no result.
What file did you copy beside to the executable ? (server.js ? the folder "engine.io" ?)

from pkg.

firrae avatar firrae commented on July 19, 2024

@ydubois-fr hmm, I didn't need to copy anything for Socket.io after upgrading to [email protected]. Can you fill me in on what OS you are on and copy any log you get here? That might help identify what the issue might be.

Also check that you have the latest pkg installed via npm i -g pkg.

from pkg.

ydubois-fr avatar ydubois-fr commented on July 19, 2024

@firrae my node version is v7.10.0, my pkg version is 3.0.3. My OS is windows 10.
I reinstall all my node modules.
I have the warning message when i compile my file.
When i launch my generated executable, all is ok but when i try to communicate with the browser, nothing....socket.io don't work.
Thanks for your help

from pkg.

igorklopov avatar igorklopov commented on July 19, 2024

@ydubois-fr You need to specify 'assets' directory as assets. For example, create package.json:

{
  "name": "views",
  "bin": "views.js",
  "pkg": {
    "assets": "assets"
  }
}

and then run pkg package.json

from pkg.

ydubois-fr avatar ydubois-fr commented on July 19, 2024

@Igoklopov PERFECT..... Thank you very much.....you solve my problem....everything works.....Thanks you. It's perfect.
@firrae Thank you for your help and the interest that you have brought to my problem. thanks a lot for your help

from pkg.

goforward01 avatar goforward01 commented on July 19, 2024

Sorry for so late reply, Thanks @igorklopov @firrae @ydubois-fr, I'll try again later.

from pkg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.