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

Add --preserve-npm #513

Closed
wants to merge 1 commit into from
Closed

Conversation

shadowspawn
Copy link
Collaborator

Pull Request Template:

Describe what you did

Added option for preserving npm during node install/activate.

How you did it

Added a new flag and only changed behaviour if flag used. Used tar for the heavy lifting.

How to verify it doesn't effect the functionality of n

Code inspection that this adds a new code path, so existing functionality unaffected.

If this solves an issue, please put issue in PR notes.

#210
#488

If this solves an issue, please include the output of issue that had problems and then the fixed output from the same command.

$ n 8.2.0
$ npm --version
5.3.0
$ npm install -g [email protected]
...
$ npm --version
6.0.0
$ n 8.1.0
$ npm --version
5.0.3
$ npm install -g [email protected]
...
$ npm --version
6.0.0
$ n -p 8.0.0
$ npm --version
6.0.0

Squash any unnecessary commits to keep history clean as possible

Place description for the changelog in PR so we can tally all changes for any future release

@shadowspawn
Copy link
Collaborator Author

Tested on macOS High Sierra, (docker) ubuntu, (docker) gentoo/stage3-amd64.

@shadowspawn
Copy link
Collaborator Author

Could also support n --preserve-npm for using with interactive version selection?

@shadowspawn
Copy link
Collaborator Author

I was looking for issues around specific versions of Linux and found #100 due to /usr/local/share/man being a link on archlinux. Using tar for --preserve-npm extraction overwrites the link with a directory which is undesirable. I will have another go with rsync and see how that goes.

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.

1 participant