我在ubuntu20 vps中在全球安装了纱线,但是当我使用纱线时,它说命令' yarn'未找到,
我使用这些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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
//techcolleage.com/yarn-command-not-found/
https://ttps : 需要将安装路径添加到您的.bashrc/.zshrc并重新加载端子/ssh会话(或重新启动您的计算机)
补充信息:
在我用来部署应用程序的bash脚本中,我要硬编码纱线路径和大多数其他可执行文件,因为奇怪的细微差别,
您会知道通过使用
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
you will know where your yarn instance is installed by doing
which yarn