Skip to content

[Bug]: Tool installation fails - 'No package manager found' when npm installed via nvm #506

@broediger

Description

@broediger

Description

When installing a tool from the marketplace, the installation fails with:

Error invoking remote method 'install-tool': Error: No package manager found. Please install pnpm or npm globally

This happens even though npm is installed globally via nvm and works correctly in the terminal.

Root Cause

On macOS, GUI apps launched from Dock or Finder don't inherit the user's shell PATH. They only see the default system PATH (/usr/bin:/bin:/usr/sbin:/sbin), which doesn't include paths like /usr/local/bin or ~/.nvm/versions/node/*/bin.

This means the app can't find npm or pnpm even when they're properly installed.

Workaround: Launching PPTB from the terminal via open "/Applications/Power Platform ToolBox.app" works because it inherits the shell PATH.

Suggested Fix

Use the fix-path package to patch process.env.PATH at app startup. This is the standard solution for this problem in Electron apps — it reads the user's actual shell PATH by running a login shell:

import fixPath from 'fix-path';
fixPath();

This should be called early in the main process before any child processes are spawned.

Environment

  • OS: macOS 15 (Sequoia)
  • Node: v24.14.0 (installed via nvm)
  • npm: 11.12.1
  • PPTB: latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    pr-in-reviewReviewing the changes. May have requested changes.

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions