npm / npm/cli

[BUG] EINVALIDPACKAGENAME on npm update -g

Open
#2,835 28 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug platform:windows Priority 2 Release 7.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Current Behavior:

Running

npm update -g

without specifying any package - i.e. update all global packages, throws this error:

npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name ".bin": name cannot start with a period

Specifying package(s) will update these packages with no problems.

Expected Behavior:

npm updates all global packages normally.

Steps To Reproduce:

run npm update -g in a terminal (either command prompt or powershell)

Environment:
  • OS: Windows 10 19042.844
  • Node: v14.16.0
  • NPM: v7.6.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce npm update -g on the reported Windows, Node, and npm versions, then trace the npm CLI entry point for global updates. Done means updating all global packages without treating .bin as an invalid package name; verify the behavior with the reported command and a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.