我在ubuntu20 vps中在全球安装了纱线,但是当我使用纱线时,它说命令' yarn'未找到,

发布于 2025-01-22 02:10:18 字数 202 浏览 1 评论 0原文

我使用这些CMD安装纱线:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g yarn

但是当我使用Yarn -v时,它显示命令“纱线”。那我现在该怎么办?

I use those cmd to install yarn:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g yarn

but when I use yarn -v, it shows Command 'yarn' not found. So what should I do now?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

药祭#氼 2025-01-29 02:10:18

//techcolleage.com/yarn-command-not-found/

https://ttps : 需要将安装路径添加到您的.bashrc/.zshrc并重新加载端子/ssh会话(或重新启动您的计算机)

补充信息:
在我用来部署应用程序的bash脚本中,我要硬编码纱线路径和大多数其他可执行文件,因为奇怪的细微差别,

YARN=/usr/bin/yarn
PM2=/usr/bin/pm2
$YARN run productionStart
$PM2 save

您会知道通过使用yarn yarn安装纱线实例的位置。

https://techcolleague.com/yarn-command-not-found/

you will need to add the install path to your .bashrc/.zshrc and reload your terminal/ssh session (or restart your machine)

supplemental info:
in my bash scripts that which I use to deploy apps, I hard code the yarn path and most other executables because of weird nuances

YARN=/usr/bin/yarn
PM2=/usr/bin/pm2
$YARN run productionStart
$PM2 save

you will know where your yarn instance is installed by doing which yarn

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文