npm 安装模块找不到对应的命令

运行 npm install -g @tarojs/cli  全局安装模块

fantingshengdeMacBook-Pro:study fantingsheng$ taro init myApp

-bash: /usr/local/bin/taro: No such file or directory

找不到相关的命令,八成是环境变量问题,设置环境变量就可以了

# 用一个通用的命令配置环境变量
~$ echo -e “export PATH=$(npm prefix -g)/bin:$PATH” >> ~/.bashrc && source ~/.bashrc

 

评论

还没有评论...留下你的评论!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar