Created
May 21, 2019 02:32
-
-
Save jsejcksn/3d2bf1a3285a3d115ec3ea4853620af2 to your computer and use it in GitHub Desktop.
Uninstalling system Node.js and npm in preparation for reinstall via nvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This list was derived from the macOS installer for Node.js v10.15 and might not be complete | |
# Additionally, if you have modified your npm prefix, you will also need to address that directory | |
/usr/local/bin/node | |
/usr/local/include/node | |
/usr/local/lib/dtrace/node.d | |
/usr/local/lib/node_modules | |
/usr/local/share/doc/node | |
/usr/local/share/man/man1/node.1 | |
/usr/local/share/systemtap/tapset/node.stp | |
/usr/local/lib/node_modules | |
$HOME/.node-gyp | |
$HOME/.node_repl_history | |
$HOME/.npm | |
$HOME/.npmrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $HOME \ | |
&& mkdir .npm-backup \ | |
&& export NVM_PREP_DIR="$HOME/.npm-backup" \ | |
&& cd $NVM_PREP_DIR \ | |
&& npm -g ls --depth 0 > "$NVM_PREP_DIR/global-packages" \ | |
&& npm -g config ls > "$NVM_PREP_DIR/config-ls" \ | |
&& npm -g config ls -l > "$NVM_PREP_DIR/config-ls-l" \ | |
&& npm -g config ls --json > "$NVM_PREP_DIR/config-ls-json" \ | |
&& echo "npm backup complete" \ | |
&& echo "Files stored at $NVM_PREP_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment