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/

相关文章:

npm 挂起从 artifactory 中拉取依赖项

download - 我无法在 centOS 7 中安装 bluefish 或任何其他网络编辑器以使用 php

bash - 在 bash 脚本中,将所有错误视为成功退出(除了最后一个错误)的最佳方法是什么?

bash - 并行检查 md5 文件

javascript - 如何将 Node 模块的 require 转换为 es6 import/export

android - Google Play 控制台 - 0 台设备支持的 Android 应用

python - 什么是构建和安装?

linux - 为什么 sed 将此替换的结果评估为 8?

bash - 当第一个参数是 Bash 中的数组时访问第二个 func 参数

node.js - Gulp 构建无法正常工作,因为当 NODE_ENV=生产时未安装 devDependency