npm / npm/cli

[BUG] npm link does not inform about symlinked packages to global node_modules anymore

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

Nobody has claimed this yet.

Bug 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:

On a project with bin field in package.json, run npm link.

/path/to/project/package.json
{
  "name": "@my-package/cli",
  "bin": {
    "my-package-cli": "./bin/cli"
  }
}
/path/to/project $> npm link

up to date, audited x packages in 1s

found 0 vulnerabilities
Expected Behavior:

There's a message with files symlinked to global node_modules

/path/to/project/package.json
{
  "name": "@my-package/cli",
  "bin": {
    "my-package-cli": "./bin/cli"
  }
}
/path/to/project$> npm link

/path/to/global/node_modules/my-package-cli -> /path/to/project

up to date, audited x packages in 1s

found 0 vulnerabilities
Steps To Reproduce:
  1. Start a new project
    /path/to/project/package.json
    {
      "name": "@my-package/cli",
      "version": "0.1.0",
      "bin": {
        "my-package-cli": "./bin/cli"
      }
    }
    
    /path/to/project/bin/cli
    #!/usr/bin/env node
    
    console.log('Hello!')
    
  2. Run npm link from package directory
  3. Expect message displaying which paths were symlinked
Environment:
  • OS: macOS 10.15.7
  • Node: 14.16.1
  • npm: 7.11.2

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 the issue with the package.json containing the bin mapping and the bin/cli entry point, then run npm link from the package directory. Trace the npm link command's output and verify that completion reports the paths symlinked into global node_modules.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.