Skip to content

Task packaging fails to correctly resolve pnpm's symlinked node_modules #556

Description

@Varorbc

Description

When developing Azure DevOps Custom Tasks and using pnpm as the package manager, the task upload command fails to correctly bundle the node_modules directory.

pnpm relies heavily on symbolic links to create its strict node_modules structure, and hardlinks to the global store for the actual files. The current implementation uses archiver (specifically archive.directory(...)) without dereferencing/following these links.

Server-Side Verification

I have manually verified this behavior directly on the Azure DevOps Agent server. Upon inspecting the extracted task directory on the server, the node_modules folder structure is incomplete and broken. The hardlinks and symlinks were stored as metadata or empty placeholders rather than being dereferenced into physical files during the zip process. The agent cannot resolve the dependencies, rendering the task completely unusable.

Expected Behavior

The packaging tool should fully dereference (follow) symlinks and hardlinks during the zipping process, copying the actual physical file contents into the archive. This ensures the .zip contains a self-contained, fully resolved node_modules tree that works seamlessly on the agent, regardless of the local package manager used (npm, yarn, or pnpm).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions