使用 yarn 安装 packages 之后出现 command not found 问题的解决办法
source link: https://blog.diqigan.cn/posts/command-not-found-error-in-yarn-packages.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
使用 yarn 安装 packages 之后出现 command not found 问题的解决办法
最近了解到 nodejs 的一款新的包管理器 yarn, 据说相对于 npm 来说有许多优点。遂果断开启试用流程,无奈遇到使用 yarn 安装 packages 之后出现 command not found 的问题,这里写出我自己的解决方法.
-
OS: Ubuntu 18.10 x86_64
Kernel: 4.18.0-16-generic
Shell: zsh 5.5.1非 root 用户登录.
-
使用 yarn 安装 Angular CLI
yarn global add @angular/cli
提示安装成功.
运行 ng 命令却提示 command not found.
-
yarn 全局安装的包其实是在
~/.yarn/bin/
目录下的,只需将这个目录配置到系统环境变量即可.echo 'export PATH=~/.yarn/bin/:$PATH' >> ~/.zshrc
source ~/.zshrc问题解决.
非 zsh 终端的用户可以将上述命令中的
.zshrc
改为.profile
即可.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK