Vue command not found / already export PATH

Viewed 100

I'm a mac user and recently started learning Vue.js. The problem I face is that every time I close and reopen terminal, I have to enter source ~/.bash_profile command to use vue command or it says command not found.

When I first installed vue/cli and tried to use vue command, it returned as command not found. Then I googled and found some information which says I should add a PATH to a file named .bash_profile. What I added is as below

export PATH="/Users/myname/.npm-global/lib/node_modules/@vue/cli/bin:$PATH"

The path is where vue.js is installed in my PC.

When I enter which vue command and it returns /Users/myName/.npm-global/bin/vue. This is different from what I already added to .bash_profile. I wonder if this is related to the problem.

Is there any way to avoid entering source ~/.bash_profile command every time.

0 Answers
Related