Task packaging fails to correctly resolve `pnpm`'s symlinked `node_modules`

Open
#556 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript
Domain
build-system, cli

Research direction

Start at the task upload packaging path that calls archiver's archive.directory(...), then inspect how links are represented in the generated zip. Verify completion by packaging a pnpm-installed task and confirming the extracted node_modules contains usable file contents rather than symlink or hardlink metadata.

Written by the indexing model from the issue text.

Description

Area: tfx-cli triage
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).

Dominant language
TypeScript
Stars
386
Forks
142
Avg merge
1d 22h
Merged PRs (30d)
7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/tfs-cli

All issues in microsoft/tfs-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.