The pac code add-data-source command fails on macOS when the VS Code extension installs pac CLI to the default location containing spaces: /Users/[username]/Library/Application Support/...
Node.js cannot parse the path correctly and throws "Cannot find module '/Users/[username]/Library/Application'" (truncated at the space).
Steps to Reproduce:
- Install Power Platform Tools VS Code extension on macOS
- Navigate to a Power Apps Code App project
- Run:
pac code add-data-source -a shared_commondataserviceforapps -c [connectionId] -t task
Expected Behavior:
Command executes successfully and adds the data source to the project.
Actual Behavior:
Command fails with error: "Cannot find module '/Users/[username]/Library/Application'"
Environment:
- OS: macOS (Sonoma/Sequoia)
- pac CLI: Version 1.51.1 (via VS Code extension)
- Node.js: v24.2.0
- VS Code: 1.107.0 (Universal)
- Extension: Power Platform Tools
Workaround:
Run the command on Windows and copy the generated files to macOS.
Root Cause:
The path /Users/[username]/Library/Application Support/ contains a space, which Node.js fails to handle properly when the VS Code extension invokes pac CLI.
The
pac code add-data-sourcecommand fails on macOS when the VS Code extension installs pac CLI to the default location containing spaces:/Users/[username]/Library/Application Support/...Node.js cannot parse the path correctly and throws "Cannot find module '/Users/[username]/Library/Application'" (truncated at the space).
Steps to Reproduce:
pac code add-data-source -a shared_commondataserviceforapps -c [connectionId] -t taskExpected Behavior:
Command executes successfully and adds the data source to the project.
Actual Behavior:
Command fails with error: "Cannot find module '/Users/[username]/Library/Application'"
Environment:
Workaround:
Run the command on Windows and copy the generated files to macOS.
Root Cause:
The path
/Users/[username]/Library/Application Support/contains a space, which Node.js fails to handle properly when the VS Code extension invokes pac CLI.