8

I am using Linux 18 based on Ubunt 17.04. When I run rails assets:precompile I get the following message Yarn executable was not detected in the system

When I follow the instruction for the installation like in this Post or on the Webpage, I install Yarn successfully, but rails keeps giving me the error

I notice that node.js has system packages for Linux Mint up to version 17.2 , I tried to do all the instruction for the Yarn page and install manually node.js which was already installed in my system.

The message is not really explanatory of the problem. If I run yarn --help it works and my yarn --version is 0.22

This is my Linux Mint system

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18
DISTRIB_CODENAME=sarah
DISTRIB_DESCRIPTION="Linux Mint 18 Sarah"
NAME="Ubuntu"
VERSION="16.04 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
cat: /etc/upstream-release: Is a directory

Update

This is the output of my echo $PATH in the terminal /opt/yarn-0.22/bin, but when I go to that path, there is no folder /opt/yarn-0.22 so I need to understand where it was installed and configure correctly the PATH SETUP

Path Setup

If you chose manual installation, the following steps will add Yarn to path variable and run it from anywhere.

Note: your profile may be in your .profile, .bash_profile, .bashrc, .zshrc, etc.

Add this to your profile: export PATH="$PATH:/opt/yarn-[version]/bin" (the path may vary depending on where you extracted Yarn to)
In the terminal, log in and log out for the changes to take effect
To have access to Yarn’s executables globally, you will need to set up the PATH environment variable in your terminal. To do this, add export PATH="$PATH:`yarn global bin`" to your profile.

Thanks a lot Best Regards Fabrizio Bertoglio

12
  • do you have yarn cli install as global package?
    – uzaif
    Aug 4, 2017 at 5:55
  • @uzaif hi, you are right. This is the output of my echo $PATH in the terminal /opt/yarn-0.22/bin, but when I go to that path, there is no folder /opt/yarn-0.22 so I need to understand where it was installed and configure correctly the PATH SETUP Aug 4, 2017 at 7:35
  • It's installed in global node_module directory which is located under home
    – uzaif
    Aug 4, 2017 at 7:40
  • @uzaif you have linux mint? I have the executable file in /usr/bin and I can run yarn with /usr/bin/yarn or yarn.. but probably when rbenv runs yarn command, it just does not work. I did include in my bash profile export PATH="$PATH:/usr/bin/yarn" In Linux / is the root directory, /home/<username/ is the user directory. Yarn is installed in the root directory and to be executed with the yarn command I should include in my $PATH variable export PATH="$PATH:/usr/bin/yarn" Aug 4, 2017 at 7:52
  • 1
    @uzaif not using webpacker or create-react-app ... I am just using rails, don't know why this yarn came out.. I am using some jquery plugin... can't really determine the real issue right now. this solution should be ok for a while.. you can post your answer i will accept it thanks Aug 4, 2017 at 8:27

1 Answer 1

21

yarn is node package manager yarn

you have to install it as here instrauction installation guide If you have node and npm you can install it via

npm install yarn -g


If you dont have npm in your machine go to this link and install node which will also install npm


If you want to manage multiple version node like RVM then you need to checkout this link

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.