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

fix: issue-6960 Correctly handle scenario where prefix is the current working directory #7208

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

ficocelliguy
Copy link

@ficocelliguy ficocelliguy commented Feb 7, 2024

closes #6960

Currently, when running npm install, if the --prefix flag is provided and set to the current working directory, this triggers some logic intended for a global install. Specifically, it makes npm.globalDir and npm.prefix the same. This causes the package ["."] to be included in the dependencies needed, adding a reference to the current directory to package.json as an empty file: dependency.

This PR ensures that the global install logic in install.js is only run for global installs.

@ficocelliguy ficocelliguy requested a review from a team as a code owner February 7, 2024 04:23
@ficocelliguy ficocelliguy changed the title Fix: issue-6960 Correctly handle scenario where prefix is the current working directory fix: issue-6960 Correctly handle scenario where prefix is the current working directory Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] npm install --prefix="$PWD" adds invalid dependency to package.json
1 participant