Skip to content

Package with @ and . in it causes splatting operating error '@' on Powershell #1794

@Nick2bad4u

Description

@Nick2bad4u

Steps to Reproduce

  1. Check for global package updates:
ncu -g
  1. npm-check-updates outputs a command similar to:
ncu itself cannot upgrade global packages. Run the following to upgrade all global packages:

npm -g install @anthropic-ai/claude-agent-sdk@0.3.170 @bomb.sh/tab@0.0.16 @github/copilot@1.0.61 @google/gemini-cli@0.45.3 @openai/codex@0.139.0 @typescript/native-preview@7.0.0-dev.20260609.1 electron@42.4.0 prettier@3.8.4
  1. Copy and paste the generated command directly into PowerShell.

  2. PowerShell throws a parser error:

ParserError:
Line |
   1 |  npm -g install @anthropic-ai/claude-agent-sdk@0.3.170 @bomb.sh/tab@0. …
     |                                                        ~~~~~
     | The splatting operator '@' cannot be used to reference variables in an expression. '@bomb' can be used only as
     | an argument to a command. To reference variables in an expression use '$bomb'.

Working Command

Quoting the package containing a scoped name with a period in the scope allows the command to run successfully:

npm -g install @anthropic-ai/claude-agent-sdk@0.3.170 "@bomb.sh/tab@0.0.16" @github/copilot@1.0.61 @google/gemini-cli@0.45.3 @openai/codex@0.139.0 @typescript/native-preview@7.0.0-dev.20260609.1 electron@42.4.0 prettier@3.8.4

Current Behavior

When ncu -g generates an upgrade command containing a package whose scope includes a period (for example, @bomb.sh/tab), the suggested command cannot be pasted directly into PowerShell because PowerShell interprets the scope name as an invalid splatting expression and throws a parser error.

Expected Behavior

The generated command should be directly executable in supported shells, including PowerShell.

One possible fix would be to automatically quote package names whose scope contains characters that require quoting in PowerShell, e.g.:

npm -g install @anthropic-ai/claude-agent-sdk@0.3.170 "@bomb.sh/tab@0.0.16" @github/copilot@1.0.61 @google/gemini-cli@0.45.3 @openai/codex@0.139.0 @typescript/native-preview@7.0.0-dev.20260609.1 electron@42.4.0 prettier@3.8.4

Environment

  • npm-check-updates: latest
  • Node.js: compatible supported version
  • Shell: PowerShell (Windows)
  • .ncurc: none (global update check with ncu -g)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions