vue-cli-service: command not found 的解决方法

今天拉完项目,vue-cli这个包也已经安装了,结果不能运行​vue-cli-service命令,找了半天终于在网上找到解决方案。

原因: vue-cli-service 并没有加入到环境变量里
 

# 编辑根目录下的.bash_profile文件
vim ~/.bash_profile

# 在文件最后添加
export PATH=${PATH}:./node_modules/.bin

# 添加文件后,再执行source立即生效

  1. source ~/.bash_profile

猜你喜欢

转载自blog.csdn.net/qq_42365082/article/details/127154898