bash - "Yarn: command not found"即使安装后

标签 bash npm installation yarnpkg

我正在尝试在我的计算机上安装 metronic,为此我需要安装 yarn。所以我运行了命令:

npm install --global yarn /Users/cbarrial/.npm-global/bin/yarn -> /Users/cbarrial/.npm-global/lib/node_modules/yarn/bin/yarn.js /Users/cbarrial/.npm-global/bin/yarnpkg -> /Users/cbarrial/.npm-global/lib/node_modules/yarn/bin/yarn.js + yarn@1.16.0 updated 1 package in 0.376s



所以我想安装工作正常,但是如果我尝试使用 yarn 命令,我会得到这个:

yarn --version -bash: yarn: command not found



我不知道问题出在哪里,我已经安装了最新的 npm 和 node.js 并且工作正常。

最佳答案

您可以安装 yarn 在接下来的方式:

sudo apt-get install curl # Only if you don't have installed curl
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install  yarn
这种方式是在 debian/ubuntu 上安装 yarn 的替代方法,但您可以在 official page for Yarn 中找到适用于不同操作系统的替代安装。在 部分替代品

关于bash - "Yarn: command not found"即使安装后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56687755/

相关文章:

bash - 使用 shell 脚本将环境变量注入(inject) Jenkins 构建过程

windows - Bash in Git for Windows : Weirdness when running a command with CMD. exe/C with args

npm - 运行npm init时git仓库问题的用法是什么?

twitter-bootstrap-3 - 通过 NPM 获取 Bootstrap 并包含到 html

python - 使用 pip install 安装 ssl 时遇到问题 : "SyntaxError: Missing parentheses in call to ' print'"

arrays - 如何在 Linux Bash 中将 ls 分配给数组?

bash - 使用 bash 脚本从 lm 传感器计算温度的平均值

linux - npm 包未在 Linux 上执行

c# - 添加 "Microsoft Access Database Engine 2010 Redistributable"作为 clickonce 的先决条件

installation - Inno Setup 在 Windows x64 上设置命名管道