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

packaging app into executable throws error #5

Open
vkefallinos opened this issue Jan 6, 2020 · 3 comments
Open

packaging app into executable throws error #5

vkefallinos opened this issue Jan 6, 2020 · 3 comments

Comments

@vkefallinos
Copy link

I use zeit/pkg to package my cli-app into an executable.
It gives two warnings while packaging:

    > Warning Cannot include file %1 into executable.
   The file must be distributed with executable as %2.
    node_modules/opn/xdg-open
    path-to-executable/xdg-open
    > Warning Failed to make bytecode node10-x64 for file /snapshot/gen-codes- 
    repo/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js

and an error while running the executable:

  /snapshot/gen-codes-repo/node_modules/yoga-layout-prebuilt/yoga-            
  layout/build/Release/nbind.js:53
    throw ex;
    ^

   Error: Cannot find module '/snapshot/gen-codes-repo/packages/cli/build/commands/index.js'

Have you found a way to package a pastel/ink app into an executable?

ps.
Thank you for your amazing work!!!

@vadimdemedes
Copy link
Owner

Unfortunately can't help you here, never needed to do this, so I haven't encountered/fixed it myself.

@davidwlhlm
Copy link

davidwlhlm commented May 12, 2021

Hi @vkefallinos! Were you able to resolve the issue? I'm experiencing the same issue right now and unfortunately I haven't found any solution so far.

Edit: It turns out that the warning message regarding yoga-layout-prebuilt is really just a warning, there must be an issue with the JavaScript in the index.js file as indicated by the error. In my setup with TypeScript, I had used the ncc package (from the same vendor as pkg) to transpile and bundle my code. I removed ncc from the project and replaced it with TypeScript's tsc, and it just worked.

@zhuhe25
Copy link

zhuhe25 commented Sep 27, 2021

你把无法打包的文件从 node_modules 里复制出来,然后 copy 到 .exe 文件的同级目录下,并修改引用路径就 ok 了

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

4 participants