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

Symlinks are invalid after moving node_modules #6865

Closed
jeanbmar opened this issue Sep 27, 2022 · 2 comments
Closed

Symlinks are invalid after moving node_modules #6865

jeanbmar opened this issue Sep 27, 2022 · 2 comments

Comments

@jeanbmar
Copy link

jeanbmar commented Sep 27, 2022

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Amazon Linux 2
  • TensorFlow.js installed from (npm or script link): "@tensorflow/tfjs-node": "^3.20.0"
  • TensorFlow.js version: "@tensorflow/tfjs-node": "^3.20.0"
  • CUDA/cuDNN version: not appicable

Describe the problem

Symlinks seem to use an absolute path:

try {
await symlink(
path.relative(
path.dirname(destLibTensorFlowPath), depsLibTensorFlowPath),
destLibTensorFlowPath);

I'm talking about the path parameter of fs.symlink, which is destLibTensorFlowPath here.
Using an absolute path prevents moving the node_modules folder, e.g. when packaging deployable archives for cloud use.
For instance and as an additional reference, npm copy will break tfjs-node when it lands in main.

Attempting to run tfjs will throw libtensorflow.so.2: cannot open shared object file: No such file or directory.
I have checked the symlinks and they are indeed invalid.

Symlinks can use a relative path, as seen in the first example at https://nodejs.org/api/fs.html#fssymlinktarget-path-type-callback.

Provide the exact sequence of commands / steps that you executed before running into the problem

  1. Install tfjs-node
  2. Move node_modules, package.json and an index.js that references tfjs
  3. Run index.js
@jeanbmar
Copy link
Author

My apologies, the issue comes from npm copy breaking the symlinks.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants