轨道资源:预编译 系统中未检测到 Yarn 可执行文件



我正在使用基于 Ubunt 17.04 的 Linux 18。 当我运行rails assets:precompile时,我收到以下消息Yarn executable was not detected in the system

当我按照本文或网页上的安装说明进行操作时,我成功安装了 Yarn,但 rails 一直给我错误

我注意到node.js具有Linux Mint的系统软件包,最高版本为17.2,我尝试执行Yarn页面的所有说明并手动安装node.js已经安装在我的系统中。

该消息并不能真正解释问题。如果我运行yarn --help它可以工作,我的yarn --version0.22

这是我的Linux Mint系统

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

更新

这是我在终端/opt/yarn-0.22/bin中的回声$PATH的输出,但是当我转到该路径时,没有文件夹/opt/yarn-0.22所以我需要了解它的安装位置并正确配置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.

多谢 此致敬意 法布里齐奥·贝尔托格里奥

yarn is node package manager yarn

您必须按照此处安装它 Instrauction 安装指南 如果你有节点和npm,你可以安装它 通过

npm install yarn -g


如果您的机器中没有npm,请转到此链接并安装node这也将安装npm


如果您想像RVM一样管理多版本节点,则需要查看此链接

最新更新