Skip to content

fix: JS/TS config execution uses npx inside pnpm, causing failures due to npm warnings on stderr #310

@krema

Description

@krema

Syncpack version

14.0.0-alpha.32

Operating system(s)

Mac

Steps to reproduce

  1. Use pnpm as the package manager.
  2. Add a JS/TS-based syncpack config (for example .syncpackrc.js or .syncpackrc.cjs):
module.exports = {
  semverGroups: [
    { dependencyTypes: ["peer"], range: "^" }
  ]
};
  1. Run syncpack via pnpm:

pnpm exec syncpack fix --config .syncpackrc.cjs

Expected behavior

  • syncpack should successfully load and execute the JS/TS config file when run via pnpm exec
  • No npm-related warnings should be emitted
  • The command should not fail due to stderr output unrelated to syncpack itself

Actual behavior

  • syncpack spawns npx internally when loading JS/TS configs
  • Because the process is already running under pnpm, npm receives pnpm-specific env config (e.g. npm_config_verify_deps_before_run)
  • npm prints:

node.js/npx/tsx process failed swith stderr: npm warn unknown env config "verify-deps-before-run"

Contents of syncpack configuration file

module.exports = {
  semverGroups: [
    { dependencyTypes: ["peer"], range: "^" }
  ]
};

Optional comments

Problem is probably here: https://github.com/JamieMason/syncpack/blob/main/src/rcfile/javascript.rs#L75

let runner = if use_bunx { "bunx" } else { "npx" };

This causes npm to be invoked inside a pnpm process, which is not a supported or safe combination and leads to npm warnings being emitted on stderr.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions