{"id":13588248,"url":"https://github.com/brock/node-reinstall","last_synced_at":"2025-04-04T18:08:00.216Z","repository":{"id":28193383,"uuid":"31695383","full_name":"brock/node-reinstall","owner":"brock","description":"Complete Node Reinstall for OSX and Linux","archived":false,"fork":false,"pushed_at":"2023-10-24T14:39:08.000Z","size":4541,"stargazers_count":543,"open_issues_count":9,"forks_count":71,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-28T17:08:11.173Z","etag":null,"topics":["installer","nodejs"],"latest_commit_sha":null,"homepage":"http://git.io/node-reinstall","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-05T04:15:23.000Z","updated_at":"2025-02-24T19:46:35.000Z","dependencies_parsed_at":"2024-06-02T00:31:53.229Z","dependency_job_id":"222c1647-4696-456f-970f-0f39be981e6d","html_url":"https://github.com/brock/node-reinstall","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brock%2Fnode-reinstall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brock%2Fnode-reinstall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brock%2Fnode-reinstall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brock%2Fnode-reinstall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brock","download_url":"https://codeload.github.com/brock/node-reinstall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["installer","nodejs"],"created_at":"2024-08-01T15:06:35.740Z","updated_at":"2025-04-04T18:08:00.199Z","avatar_url":"https://github.com/brock.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"\nBy [brock](https://github.com/brock) - Featuring [jwerle](https://github.com/jwerle), [hanoii](https://github.com/hanoii), [mistergraphx](https://github.com/mistergraphx), [gitter-badger](https://github.com/gitter-badger), \u0026 [seguri](https://github.com/seguri)\n\n---\n\nNode-Reinstall is going to delete a lot of shit, and you won't be able to recover any of it. Do yourself a favor and make sure that you read the [node-reinstall](./node-reinstall) script and completely understand what it is going to do (i.e.: *what it is going to delete*) before you proceed. Here is an expanded version of the script that shows all of the directories that will be deleted:\n\n```\nrm -rf ~/local\nrm -rf ~/lib\nrm -rf ~/include\nrm -rf ~/node*\nrm -rf ~/npm\nrm -rf ~/.npm*\nsudo rm -rf /usr/local/lib/node*\nsudo rm -rf /usr/local/include/node*\nsudo rm -rf /usr/local/bin/node\nsudo rm -rf /usr/local/bin/npm\nsudo rm -rf /usr/local/share/doc/node\nsudo rm -rf /usr/local/share/man/man1/node.1\nsudo rm -rf /usr/local/share/systemtap/tapset/node.stp\nsudo rm -rf /usr/local/lib/dtrace/node.d\n```\n\nAt an absolute minimum, you need to go into the home directories (the ones that start with `~/`) and make sure you are okay with deleting the contents of those directories. If you are unsure if this will delete anything important, you should stop now and find another alternative for re-installing Node.js, because this approach is pretty destructive.\n\nThis script assumes you are comfortable enough with UNIX to perform these actions. If you are not, I will respond to your GitHub issue with the following GIF that is titled \"pay-attention.gif\"  \n\n![](img/pay-attention.gif)\n\n## Summary\nThis is a complete (and very destructive) tool for re-installing Node.js on OSX and Linux. See the [SO article](http://stackoverflow.com/a/11178106/2083544) for reference and the related [gist that spawned this repo](https://gist.github.com/brock/5b1b70590e1171c4ab54). This deletes ~~everything, yes everything,~~ **a lot of stuff you might want** and completely removes Node.js and NPM and replaces it with the Node Version Manager called [NVM](https://github.com/creationix/nvm). It will attempt to re-install any global NPM modules already installed, and you can opt for Nave instead of NVM if you prefer.\n\nIt also works as a first-time installer.\n\n## Installation\n\n### Clone this Repo\n\nClone this repo somewhere. If you have SSH setup with GitHub, use this format:\n```\ngit clone git@github.com:brock/node-reinstall.git\n```\n\nOtherwise, clone this repo using HTTPS:\n```\ngit clone https://github.com/brock/node-reinstall.git\n```\n\n### Run the Re-Installer\nChange into the directory:\n```\ncd node-reinstall\n```\n\nTo run `node-reinstall`, you can call it directly since it is an executable file:\n\n```\n./node-reinstall\n```\n\nOr you can run it with bash:\n```\nbash node-reinstall\n```\n---\nIf you decide later that you want to re-install Node.js all over again, just come back to the directory where you cloned the `node-reinstall` repo, optionally update to the latest version of `node-reinstall` by running `git pull`, then run it again:\n\n```\ngit pull\nbash node-reinstall\n```\n\n## Optional\nIf you are comfortable with Bash and the command line, you can copy the `node-reinstall` file to someplace in your [$PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29)\n```\ncp node-reinstall ~/bin/node-reinstall\n```\n\nWith `node-reinstall` in your [$PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29) you can execute it from any directory:\n```\nnode-reinstall\n```\n\n\n## Usage\n\nWhenever you feel like you need to completely re-install Node and NPM, simply execute `node-reinstall`. You'll be prompted for sudo privileges since this will remove all possible installation paths. Pull requests welcome.\n\n\n    Usage:\tnode-reinstall [--nave|--nvm|--nvm-latest] [-h|--help] [-v|--version] [NODE_VERSION]\n\n## Commands\n\n\tnode-reinstall\t\t\t\t\tre-install node and npm using nvm\n\tnode-reinstall [-h|--help]\t\tshow help\n\tnode-reinstall [-v|--version]\tshow the node-reinstall version number\n\tnode-reinstall [-f|--force]\t\tinstalls defaults without user confirmation\n\tnode-reinstall --nave\t\t\tre-install using nave\n\tnode-reinstall --nvm\t\t\tre-install using stable nvm - the default\n\tnode-reinstall --nvm-latest\t\tre-install using latest nvm - creationix/nvm:master\n\tnode-reinstall 5.0.0\t\t\tspecify a default node version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrock%2Fnode-reinstall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrock%2Fnode-reinstall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrock%2Fnode-reinstall/lists"}