Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Splatting operator @ cannot be used with adding npm kit on windows #20153

Open
2 tasks done
barrychapman opened this issue Mar 11, 2024 · 6 comments
Open
2 tasks done

Comments

@barrychapman
Copy link

barrychapman commented Mar 11, 2024

Bug description

PS D:\Projects\barrychapman> npm i --save @awesome.me/kit-0d80*****

As per docs:
image

+ 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

  • I have included a test case because my odds go way up that the team can fix this when I do
  • I have searched for existing issues and to the best of my knowledge this is not a duplicate
@barrychapman barrychapman added bug needs-triage This bug needs to be confirmed labels Mar 11, 2024
@hagealex
Copy link

Hello @barrychapman I have faced the same issues while trying to install the package using the Windows terminal. With git Git Bash it worked.

@tagliala
Copy link
Member

Are there any OS related issue with npm and @ in file names?

@hagealex
Copy link

hagealex commented Mar 12, 2024

@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 :)

@tagliala tagliala added doc and removed needs-triage This bug needs to be confirmed labels Mar 12, 2024
@tagliala tagliala changed the title Bug: Splatting operator @ cannot be used with adding npm kit Bug: Splatting operator @ cannot be used with adding npm kit on windows Mar 12, 2024
@tagliala tagliala added enhancement and removed bug labels Mar 12, 2024
@CoderBrad
Copy link

You can also use single quotes to get around this issue. For example:
npm install '@awesome.me/kit-KIT-CODE'

@tagliala tagliala added waiting for feedback needs-triage This bug needs to be confirmed labels Mar 20, 2024
@tagliala
Copy link
Member

tagliala commented Mar 20, 2024

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?

@CoderBrad
Copy link

CoderBrad commented Mar 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants