From d76674e5b12d1f3200819c61f81fa70920aa17bf Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Wed, 5 Aug 2020 20:47:35 -0500 Subject: [PATCH] Add Fix Unlinked Node Binaries With asdf as a unix til --- README.md | 3 ++- unix/fix-unlinked-node-binaries-with-asdf.md | 24 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 unix/fix-unlinked-node-binaries-with-asdf.md diff --git a/README.md b/README.md index 9e8c3ed..18e99ef 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_940 TILs and counting..._ +_941 TILs and counting..._ --- @@ -857,6 +857,7 @@ _940 TILs and counting..._ - [File Type Info With File](unix/file-type-info-with-file.md) - [Find Files With fd](unix/find-files-with-fd.md) - [Find Newer Files](unix/find-newer-files.md) +- [Fix Unlinked Node Binaries With asdf](unix/fix-unlinked-node-binaries-with-asdf.md) - [Forward Multiple Ports Over SSH](unix/forward-multiple-ports-over-ssh.md) - [Get Matching Filenames As Output From Grep](unix/get-matching-filenames-as-output-from-grep.md) - [Get The Unix Timestamp](unix/get-the-unix-timestamp.md) diff --git a/unix/fix-unlinked-node-binaries-with-asdf.md b/unix/fix-unlinked-node-binaries-with-asdf.md new file mode 100644 index 0000000..ff147c6 --- /dev/null +++ b/unix/fix-unlinked-node-binaries-with-asdf.md @@ -0,0 +1,24 @@ +# Fix Unlinked Node Binaries With asdf + +You're using `asdf` to manage your version(s) of `node.js`. You have some +packages globally installed with `yarn` that are available as executable +binaries. When you install and switch to a new version of Node, those global +binaries no longer work. + +Even uninstalling and re-installing those particular packages doesn't +necesarily fix it. That's because broken symlinks have been left behind. + +`asdf` can help fix this with its `reshim` command: + +```bash +$ asdf reshim +``` + +For instance, if you want to start using `14.4.0`, you can reshim like this: + +```bash +$ asdf reshim nodejs 14.4.0 +``` + +This will re-sync all the symlinks so that you are able to access and run those +binaries again.