Skip to content

[BUG] npm link removes other links #3745

Closed
@Gopikrishna19

Description

@Gopikrishna19

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Linking package1

$ npm link @myscope/package1 

changed 1 package, and audited 603 packages in 10s
found 0 vulnerabilities
$ ll node_modules/@myscope
total 0
lrwxrwxrwx 1 Gopi 123 32 Sep 13 10:35 package1 -> /d/Projects/Websites/package1/
drwxr-xr-x 1 Gopi 123 0 Sep 10 12:09 package2/
drwxr-xr-x 1 Gopi 123 0 Sep 13 10:35 package3/

Linking package2

$ npm link @myscope/package2

changed 2 packages, and audited 603 packages in 10s
found 0 vulnerabilities
$ ll node_modules/@myscope
total 0
drwxr-xr-x 1 Gopi 123 32 Sep 13 10:35 package1/
lrwxrwxrwx 1 Gopi 123 0 Sep 10 12:09 package2 -> /d/Projects/Websites/package2/
drwxr-xr-x 1 Gopi 123 0 Sep 13 10:35 package3/

Expected Behavior

Linking package1

$ npm link @myscope/package1 

changed 1 package, and audited 603 packages in 10s
found 0 vulnerabilities
$ ll node_modules/@myscope
total 0
lrwxrwxrwx 1 Gopi 123 32 Sep 13 10:35 package1 -> /d/Projects/Websites/package1/
drwxr-xr-x 1 Gopi 123 0 Sep 10 12:09 package2/
drwxr-xr-x 1 Gopi 123 0 Sep 13 10:35 package3/

Linking package2

$ npm link @myscope/package2

changed 1 package, and audited 603 packages in 10s
found 0 vulnerabilities
$ ll node_modules/@myscope
total 0
drwxr-xr-x 1 Gopi 123 32 Sep 13 10:35 package1 -> /d/Projects/Websites/package1/
lrwxrwxrwx 1 Gopi 123 0 Sep 10 12:09 package2 -> /d/Projects/Websites/package2/
drwxr-xr-x 1 Gopi 123 0 Sep 13 10:35 package3/

Steps To Reproduce

  1. Start a project with multiple sibling dependencies
  2. Link a sibling package
  3. LInk another sibling package
  4. The first sibling is no longer linked

Environment

  • OS: Windows 10
  • Node: v16.3.0
  • npm: 7.15.1

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 releaseplatform:windowsis Windows-specific

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions