Font-Awesome
Font-Awesome copied to clipboard
Bug: Splatting operator @ cannot be used with adding npm kit on windows
Bug description
PS D:\Projects\barrychapman> npm i --save @awesome.me/kit-0d80*****
As per docs:
+ npm i --save @awesome.me/kit-0d80*****
+ ~~~~~~~~
The splatting operator '@' cannot be used to reference variables in an expression. '@awesome' can be used only as an argument to a command. To reference variables in an expression use '$awesome'.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : SplattingNotPermitted
Font Awesome version
v6
Application and Operating System
Webstorm Windows 11
Web bug report checklist
- [X] I have included a test case because my odds go way up that the team can fix this when I do
- [X] I have searched for existing issues and to the best of my knowledge this is not a duplicate
Hello @barrychapman I have faced the same issues while trying to install the package using the Windows terminal. With git Git Bash it worked.
Are there any OS related issue with npm
and @
in file names?
@tagliala I just saw this is an issue related to the Windows terminal:
Sometimes, the Windows command prompt interprets special characters differently. If you're using the command prompt, you might need to escape the "@" symbol by using a caret (^) before it, like this: npm install ^@package-name.
So for Windows terminal the command must be:
npm install ^@awesome.me/kit-KIT-CODE
Might be worth to add this to your documentation :)
You can also use single quotes to get around this issue. For example:
npm install '@awesome.me/kit-KIT-CODE'
I'm not sure that this should be added to the docs, because it is platform-dependent, it is how the platform work, and I do not remember seeing instructions for different OSes in @
scoped node packages.
I think that a warning is more appropriate in this case
As an example, I can provide @popperjs/core
, which is a very known package especially in bootstrap ecosystem.
Do you have examples of other packages with instructions specific to windows?
The issue only occurs when the scope includes a .
in the name (older versions of powershell had an issue with the @ as well but that was fixed a while ago at this point). I agree that a warning would be appropriate since most people will probably not encounter this issue. @neville.dabreo/greetingbot
is a random example I found of a package with the same issue.