While the yarn is not your path you don’t have yarn installed in your system, Then you will face IndentationError: unexpected indent, this error.
In this article, we will discuss about this yarn: command not found error in NodeJs. And how to resolve the error all the possible solutions with examples.
How to yarn: command not found Error Occurs?
Most of the time you get this error while trying to install yarn then you will face this error.
yarn: command not found
How To Fix yarn: command not found Error?
There are different ways to fix yarn: command not found this error. Let us take a look at every solution.
- How To Fix yarn: command not found Error?
For the solve yarn: command not found error First of all, you need to install yarn globally and then add yarn to your PATH Variable. Just open your terminal and install the yarn by running this command: npm install -g yarn And then verify whether the yarn is installed or not by running this command: yarn –version. Now, I hope your error will be gone.
Solution 1: Install yarn
Just open your terminal and install the yarn globally by this command:
npm install -g yarn
Then verify whether your yarn is installed or not by running this command:
Now, I hope your error will be gone.
Solution 3: Run this command
This way to solve the error you need to add the npm path into your path variable. If you don’t know your NPM path then run this command below.
npm config get prefix
After run the command will give you the full path of the npm folder which you need to set as a PATH variable.
# 👇️ Replace Path with Your npm folder path export PATH="/usr/local/share/npm/bin:$PATH"
Now, restart your terminal and run the yarn –version.
In this article, we have discussed what causes the error and we have discussed ways to fix the error.
we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.