npm's valid dot‑scopes break on Windows without (single) quotes #169922
Replies: 1 comment
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
Hello everyone, maintainer of the
@igor.dvlpr
scope here with published ~60 packages under this scope.The problem:
npm's registry and CLI allow dots in scope names, but PowerShell on Windows fails to parse them unless the name is wrapped in (single) quotes. Despite this, the install command shown on npmjs.com omits the quotes, leading to immediate errors for Windows users who copy‑paste the official command. I do mitigate this by providing my own install command in the package's README but it's not optimal nor desired.
The problem involves all present and future packages with a scope name that contains a dot - not just mine.
Taken from one of my package's npm page:
To elaborate, following the official npm documentation which states:
The same rules apply to scope name; thus, it can contain dots, hyphens and underscores.
Why it happens:
When the npm-provided command:
gets executed in PowerShell - which is the default command line for Windows10+ shell - it will throw an exception:
The splatting operator '@' cannot be used to reference variables in an expression. '@igor' can be used only as an argument to a command. To reference variables in an expression use '$igor'.
More info on the official PowerShell splatting documentation.The exception occurs because it tries to access a property, in this case, it tries to access the property
dvlpr/astro-component
of the variable$igor
- neither of those exists, nor is valid. Also, notice the highlighting, in the first command$igor
is indeed recognized/highlighted as a variable.Hopefully we can address this somehow and get it fixed for everyone soon, thank you.
Beta Was this translation helpful? Give feedback.
All reactions