是因为 macOS 环境下的环境变量没有配置的原因;
将全局 node_modules 目录添加到 bash_profile 中
vi ~/.bash_profile
.bash_profile 内容
export NODE_PATH=/usr/local/lib/node_modules
使 .bash_profile 生效
source ~/.bash_profile
是因为 macOS 环境下的环境变量没有配置的原因;
将全局 node_modules 目录添加到 bash_profile 中
vi ~/.bash_profile
.bash_profile 内容
export NODE_PATH=/usr/local/lib/node_modules
使 .bash_profile 生效
source ~/.bash_profile
转载于:https://my.oschina.net/u/3117745/blog/1359103