今天拉完项目,vue-cli这个包也已经安装了,结果不能运行vue-cli-service命令,找了半天终于在网上找到解决方案。
原因: vue-cli-service
并没有加入到环境变量里
# 编辑根目录下的.bash_profile文件
vim ~/.bash_profile
# 在文件最后添加
export PATH=${PATH}:./node_modules/.bin
# 添加文件后,再执行source立即生效
-
source ~/.bash_profile
原因: vue-cli-service
并没有加入到环境变量里
# 编辑根目录下的.bash_profile文件
vim ~/.bash_profile
# 在文件最后添加
export PATH=${PATH}:./node_modules/.bin
# 添加文件后,再执行source立即生效
source ~/.bash_profile