Problem:
1. line 238 contains mojibake (UTF-8 em dash mis-decoded) and a curly closing quote (U+201D) instead of ASCII ", so the string never terminates and { is parsed as code. Fixing the string to use ASCII quotes and a normal hyphen.
2. On Windows, npm is implemented as npm.ps1. For many invocations it does not use $args; it takes the original command text, parses it again with PowerShell, and runs something like Invoke-Expression to call node with rebuilt arguments. A scoped package like @openacp/cli@latest is parsed incorrectly (because of @), so the args handed to npm are wrong and I got "Unknown command: "pm"".
Changes proposed:
- Introduced a new function, Resolve-NpmExecutable, to determine the correct npm executable for Windows environments.
- Updated Install-OpenACPNpm and Main functions to utilize the resolved npm executable, ensuring compatibility and reliability during installation.
- Improved logging for dry-run scenarios and retry attempts during npm installation.
- Manually tested and succeed
- Updated installation commands in README.md and scripts to remove version query parameters, simplifying the usage instructions for macOS, Linux, and PowerShell scripts.
- Modified installation commands in README.md to include versioning for macOS, Linux, and PowerShell scripts.
- Updated install.ps1 and install.sh scripts to define and display the installer version as 1.0.0, enhancing clarity for users.
- Add accepted-risk comment for NodeSource curl|bash pattern (HTTPS enforced)
- Fix wrapper script to use printf %q to safely handle special chars in repo_dir
- Add validate_args() to reject unsafe chars and path traversal in --git-dir/--version
- Add npm retry logic (3x, 2s delay) to install.ps1 to match install.sh behavior
- Fix nvm detection: replace unreliable command -v nvm with NVM_DIR/nvm.sh checks
- Add git re-check after install_git() with clear error if installation failed
- Fix PowerShell Add-ToPath null-safety for PATH on fresh installs
- Replace echo -e with printf %b to avoid flag misinterpretation in prompt_choice
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>