Skip to content
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] --force doesn't work as intended when automatically removing node_modules symlinks #4358

Open
2 tasks done
blaumeise20 opened this issue Feb 1, 2022 · 2 comments
Open
2 tasks done
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 8.x work is associated with a specific npm 8 release

Comments

@blaumeise20
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

If I have a symlink called node_modules to a different directory, then npm will remove this symlink and create a real folder. This has been introduced in npm/arborist@f2b0cee as a safety feature, but as it doesn't disable it as specified when using --force option.

Other people have similar problems too:

Expected Behavior

It should work as intended in npm/arborist@f2b0cee (don't remove symlink if --force).

I really needed this thing to work, so I had to downgrade npm to an older version.

Steps To Reproduce

  1. Create an empty folder
  2. Create a second folder inside the first one
  3. Run npm init -y
  4. Run ln -s your_folder_name node_modules
  5. Run npm install --force <any package name>
  6. node_modules no longer points to your_folder_name

Environment

  • npm: v8.3.1
  • Node.js: v17.4.0
  • OS Name: MacOS Catalina
  • System Model Name: iMac
  • npm config:
; this only showed comments and registry auth token "(protected)"
@blaumeise20 blaumeise20 added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Feb 1, 2022
@nlf nlf added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Feb 1, 2022
@kaysond
Copy link

kaysond commented Feb 16, 2022

@blaumeise20 what version did you downgrade to?

@blaumeise20
Copy link
Author

I am now using a pretty recent version from before adding this feature (restriction). I think it's v7.15, I don't have access to my home PC right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

3 participants