Linux安装yarn

  |   0 评论   |   0 浏览

安装yarn 后如下,记住yarn 路径并添加到 $PATH

[root@localhost /]# npm install -g yarn
npm WARN rm not removing /usr/local/node-v10.15.0/bin/yarn as it wasn't installed by /usr/local/node-v10.15.0/lib/node_modules/yarn
/usr/local/node-v10.15.0/bin/yarn -> /usr/local/node-v10.15.0/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.13.0
updated 1 package in 2.874s

设置当终端有效:


[root@localhost bin]# export PATH=/usr/local/node-v10.15.0/bin/:$PATH
[root@localhost bin]# echo $PATH
/usr/local/node-v10.15.0/bin/:/root/.yarn/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/hzero/.local/bin:/home/hzero/bin:

[root@localhost hzero-front]# yarn -version
1.13.0

设置永久有效

[root@localhost bin]# sudo vi /etc/profile
添加PATH="$PATH:/usr/local/nodejs/bin/"
export PATH
[root@localhost bin]#source /etc/profile  #让配置文件立即生效

标题:Linux安装yarn
作者:zytops
地址:https://zytops.com/articles/2021/07/30/1627627416171.html