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(uninstall): use correct local prefix #2930

Merged
merged 1 commit into from
Mar 24, 2021
Merged

fix(uninstall): use correct local prefix #2930

merged 1 commit into from
Mar 24, 2021

Conversation

jameschensmith
Copy link
Contributor

Summary

A commit was made in v7.7.0, which removed references to flatOptions in favor of a more unified config. This caused a bug where this.npm.config.get('prefix') was using the global prefix.

This request corrects the non-global prefix path by using this.npm.localPrefix, a location already used throughout the repository (in the same file, in lib/prefix.js, etc.). Later, this value can be taken from the unified config library.

References

Fixes #2927.

@jameschensmith jameschensmith requested a review from a team as a code owner March 24, 2021 02:27
Copy link
Contributor

@ruyadorno ruyadorno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this looks great! ❤️

can you please also add a npm.localPrefix = '' declaration in L24 along with the other resets? that will avoid carrying the path of a fixture to an unintended test in the future.

@jameschensmith
Copy link
Contributor Author

Done 🙂 Thanks for spotting that!

@ruyadorno ruyadorno linked an issue Mar 24, 2021 that may be closed by this pull request
Corrects non-global prefix path by using this.npm.localPrefix. A
location already used throughout the repository. Later, this will be
taken from the unified config library.

Signed-off-by: James Chen-Smith <jameschensmith@gmail.com>

PR-URL: #2930
Credit: @jameschensmith
Close: #2930
Reviewed-by: @ruyadorno
@ruyadorno ruyadorno changed the base branch from latest to release-next March 24, 2021 14:41
@ruyadorno ruyadorno merged commit 543b0e3 into npm:release-next Mar 24, 2021
@ruyadorno ruyadorno mentioned this pull request Mar 24, 2021
@jameschensmith jameschensmith deleted the jameschensmith/fix/non-global-uninstalls branch March 24, 2021 15:12
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] EACCES error with npm remove on npm@7.7.0 [BUG] npm uninstall doesn't work in 7.7.0
2 participants