vercel/pkg

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

jaythakor-ai opened this issue · 1 comments

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:

  • Install python-bridge in the inside modules directory of your project folder.
  • create a package with any file that should call the index.js file from the python-bridge.
  • My assets of pkg in package.json as below
    ```
    "assets": [
    "./node_modules/axios/dist/node/axios.cjs",
    "./package.json",
    "./runtime//*.json",
    "./node_modules/
    ",
    "./modules/**",
    ],

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


Help. My implementation is stuck due to this error.