npm Community Forum (Archive)

The npm community forum has been discontinued.

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

Having a package dependent on itself using symlinks

How safe is it for a package to have itself as a symlinked dependency in its own package.json? This could be accomplished by adding “<name>”: “file:” to the dependencies in package.json. The only reference I could find was in the install limitations, but the docs note that symlink would be the more correct approach.

The concrete example here would be the jasmine-core package using the jasmine package to test itself. The jasmine package has jasmine-core as a dependency. Without symlinking, making a change locally in jasmine-core and then using jasmine to test itself results in jasmine-core being tested by whatever version of jasmine-core is in npm. With symlinking, the test would use the locally changed version.