How Can I Publish Symlink

(bashen1) #1

How Can I Publish Mac Symlink

(John Gee) #2

What are you trying to do?

I have not looked at current code, but did find this older link where symlinks to outside the package are explicitly ignored:

(bashen1) #3

Like this symlink,I publish. But when I npm i
The node_modules not contain these symlink

(John Gee) #4

Ah, a macOS framework bundle with links to the current version in the versions directory. Thanks for picture.

I think the symlinks are deliberately not included by npm. I found this explanation in an old issue:

npm is not tar, and it is not git. It does not include symbolic links in packages, because they are unportable to the platforms and filesystems that npm supports.

I have not found a solution for this situation. I can think of two approaches which might work, but I am not sure how practical they are:

  • recreate the symlinks in a postinstall script, or
  • use tar to archive the frameworks before publish, and unpack as part of install

(system) closed #5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.