npm / npm/cli

[BUG] error message when `.gitignore` is a directory is not verly clear

Open
#3,956 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

When trying to do an npm publish or npm pack in a package where .gitignore is a directory, the following error happens:

~/D/n/scratch $ mkdir .gitignore
~/D/n/scratch $ npm pack --dry-run
npm WARN tarball tarball data for file:/Users/wraithgar/Development/npm/scratch (null) seems to be corrupted. Trying again.
npm WARN tarball tarball data for file:/Users/wraithgar/Development/npm/scratch (null) seems to be corrupted. Trying again.
npm ERR! code EISDIR
npm ERR! syscall read
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, read
Expected Behavior

A more helpful error message is displayed

Steps To Reproduce

See example above

Environment
  • OS: OSX
  • Node: v16.3.0
  • npm: 8.1.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

Start by reproducing the issue with npm pack --dry-run or npm publish in a package where .gitignore is a directory, as shown in the report. Trace the npm CLI path handling the .gitignore entry and compare the current EISDIR output with the expected behavior. Done means the command displays a more helpful error message.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.