Guy Park
Guy Park

Reputation: 1027

yarn no longer present

Been running my npm start, which uses yarn, over and over for the last 5 months and has been working since day dot. I even see it in my Terminal history 10 lines above.

> yarn

yarn install v1.10.1

I killed my npm start process a moment ago, and now for some reason, I get this...

> yarn

sh: yarn: command not found

Yarn is no longer installed on my system...for some reason. So I installed it and get the usual information that it's installed.

$ npm -g install yarn
+ [email protected]
added 1 package in 2.786s

But yarn still isn't installed and I'm still getting the same above issue.

I haven't done anything that would have messed up yarn in anyway (no installing/updating/removing of any packages), so I'm completely stumped as to what the heck happened.

Has anyone had this issue, know what it is and has a fix?

Upvotes: 2

Views: 2677

Answers (1)

Guy Park
Guy Park

Reputation: 1027

After a bit of playing around, it seems that killing yarn in the process of it doing it's update, killed it's global link (e.g. /usr/bin/yarn) to it's binary.

So I ran the yarn application from it's full path, which I got from the npm install -g yarn (in my case /usr/local/Cellar/node/10.12.0/bin/yarn).

This then updated yarn, reinstalling the links and fixing it, and now it's all working. :)

Upvotes: 3

Related Questions