-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] Invalid package name ".DS_Store" #7492
Comments
Why is |
I just want to custom it. |
Why? npm only comes with node, so it should only be located in the location that node ships it in. |
I separated them. This has nothing to do with why I set the And here is a related issue in old repo. |
|
Would you please try following steps to repro.
|
I definitely get the same error, but |
Seems like two legit issues: a documentation error, as well as "it should be failing with a clearer message". |
I bet |
I tried change line 445 to following, and it works. const paths = (await readdirScoped(nm).catch(() => []))
.filter(p => p !== '.DS_Store') Maybe we should fix it in cli/node_modules/@npmcli/fs/lib/readdir-scoped.js Lines 1 to 20 in e9fdc9a
|
Possibly better logic would be, to filter out anything that can’t be a valid package name? |
I agree, Maybe we should refer to |
It looks like your operating system put an invalid name in your node_modules folder. npm can't support things like this, it has to assume everything in there is something it put there. It has to error to let you know that you are now going to get unexpected results.
The solution here is to remove those files that osx put there, and configure it to stop doing that. |
As we all know, macOS may place a It's unimaginable that npm doesn't handle it.
Too idealistic.
This is not a solution. I'm starting to understand why npm is the default package manager distributed with node, but people still invent alternatives. I will move to yarn or pnpm, whatever. |
I don’t understand why this issue is closed. This should be handled by |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Exec
npm update -g
.2024-05-09T05_40_34_718Z-debug-0.log
If I remove
.DS_Store
withrm /opt/node/npm/lib/node_modules/.DS_Store
, then it works.I am on macOS, and I've set
prefix=/opt/node/npm
in.npmrc
.Environment
The text was updated successfully, but these errors were encountered: