Today I want to write about how to fix yarn global install of a package.
What is that Wolfiton?
If you remember from my previous articles that
npm can install a package globally so that you can use it from anywhere in the system or locally you will have to specify where you have it installed.
So for our example let's use
yarn global add serve in an asdf yarn configuration.
The package will get installed but when we go and run
serve nothing happens or we get the unrecognized command.
To fix that we need to run
asdf reshim nodejs.
Now if we try to use
serve we will get the following output:
serve ✔ at 20:44:45 ┌───────────────────────────────────────────────────┐ │ │ │ Serving! │ │ │ │ - Local: http://localhost:5000 │ │ - On Your Network: http://192.168.1.145:5000 │ │ │ │ Copied local address to clipboard! │ │ │ └───────────────────────────────────────────────────┘
It is working!
To exit the serve command Dear Reader press
Ctrl + c or
command + c
I hope you enjoyed the article Dear Reader
Also if you find it useful, share it on social so others can enjoy it too.
You're one click away
Level up every day