【发布时间】:2017-08-04 04:31:56
【问题描述】:
我正在使用基于 Ubuntu 17.04 的 Linux 18。
当我运行rails assets:precompile 时,我收到以下消息Yarn executable was not detected in the system
当我按照Post 或Webpage 中的安装说明进行操作时,我成功安装了 Yarn,但 rails 不断给我错误
我注意到node.js 有适用于 Linux Mint 的系统软件包,最高版本为 17.2,我尝试完成 Yarn 页面的所有说明并手动安装 node.js,它已经安装在我的系统中。
该消息并不能真正解释问题。如果我运行yarn --help 它可以工作,我的yarn --version 是0.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 所以我需要了解它的安装位置并正确配置@987654336 @
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 cli作为全局包吗?
-
@uzaif 嗨,你是对的。这是我的
echo $PATH在终端/opt/yarn-0.22/bin中的输出,但是当我转到该路径时,没有文件夹/opt/yarn-0.22所以我需要了解它的安装位置并正确配置PATH SETUP -
安装在 home 下的全局 node_module 目录中
-
@uzaif 你有 linux mint 吗?我在
/usr/bin中有可执行文件,我可以使用/usr/bin/yarn或yarn.. 运行纱线,但可能当rbenv运行yarn命令时,它只是不起作用。我确实在我的 bash 配置文件中包含了export PATH="$PATH:/usr/bin/yarn"在 Linux 中,/是根目录,/home/<username/是用户目录。 Yarn 安装在根目录中,要使用yarn命令执行,我应该在我的$PATH变量中包含 export PATH="$PATH:/usr/bin/yarn" -
@uzaif 没有使用 webpacker 或 create-react-app ...我只是在使用 rails,不知道为什么这个
yarn出来了.. 我正在使用一些 jquery 插件...现在无法真正确定真正的问题。这个解决方案应该没问题..你可以发布你的答案我会接受谢谢
标签: ruby-on-rails linux ubuntu yarnpkg