3👍
✅
The path is wrong. The binary resides in /usr/local/Cellar/node/11.2.0/bin
rather than .../lib/...
.
As you’ll notice, the file in the latter directory is named as vue.js
, not vue
.
NPM creates a symlink without the .js
extension to it in the bin
directory, and that’s the actual binary we typically refer to.
Typically we don’t use the full path in .bashrc
directly (in case the npm global path changes).
Rather, it’s recommended to calculate it by combining the result of npm config get prefix
and /bin
, i.e.
export PATH="$PATH:$(npm config get prefix)/bin"
Source:stackexchange.com