vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.33k stars 1.02k forks source link

"[Error 2] No such file or directory" for the file that is exist in the module directory #1995

Closed jaythakor-ai closed 10 months ago

jaythakor-ai commented 1 year ago

What version of pkg are you using?

5.8.1

What version of Node.js are you using?

18.9.0

What operating system are you using?

Ubuntu 22.04

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

node18

Describe the Bug

I am trying to use the python-bridge in my node application. I added the python-bridge folder in the modules directory and that modules directory is in the executable. I added the modules directory to the assets in package.json.

I am facing this error "python: can't open file '/snapshot/home/jay/project_dir/project_folder/modules/python-bridge/node_python_bridge.py': [Errno 2] No such file or directory"

I checked it manually using the existSync method of fs npm, and the "/snapshot/home/jay/project_dir/project_folder/modules/python-bridge/node_python_bridge.py" path is present but some how the pkg is not able to read that file.

Expected Behavior

It should works fine as it is working fine with other js and extension file.

To Reproduce

Follow below steps:

See the screenShot: https://github.com/vercel/pkg/assets/49632136/98b045d4-eb96-4d65-91e5-851311a47ec8

jaythakor-ai commented 1 year ago

Help. My implementation is stuck due to this error.