Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

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

Closed
jaythakor-ai opened this issue Sep 21, 2023 · 1 comment

Comments

@jaythakor-ai
Copy link

jaythakor-ai commented Sep 21, 2023

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


@jaythakor-ai
Copy link
Author

Help. My implementation is stuck due to this error.

@leerob leerob closed this as completed Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants