npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

How Can I Publish Symlink

How Can I Publish Mac Symlink


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:


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


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: https://github.com/npm/npm/issues/3310

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: