mac 全局装 npm 失败 command not found: vue

2,257 阅读1分钟
  1. 查询node 路径
where node

  1. 修改~/.bash_profile
vim ~/.bash_profile

  1. 按 e 表示编辑

  2. 添加下面文字在文件中

export PATH="$PATH:/usr/local/bin/node"

其中 : 后面表示 node 路径, 比如

export PATH="$PATH:xxxxxxxxxxxxx"

  1. 键盘按下 Esc

  2. 输入 :wq 表示保存并退出

  3. 重新加载

source ~/.bash_profile

  1. 在 ~/.zshrc 中添加
source ~/.bash_profile ~/.bashrc

如有未解决,欢迎留言。

参考: www.jianshu.com/p/48a0495e8…