Cannot be used properly after the NPM module is installed globally in MAC. Export PATH is required.

recently discovered a strange phenomenon while learning to use NPM,.
I can"t use node modules clients babel, live-server in terminal after they are installed globally. Terminal returns a prompt for-bash: babel: command not found.

I can"t fix this problem until I type export PATH=$PATH:/Users/username/npm-global/bin. But when I open the second window with command+t, I need to type export PATH=$PATH:/Users/username/npm-global/bin again to start using these globally installed modules.

does anyone know what the reason is?

May.06,2021

you opened a different window path. This problem should not exist if it is installed globally

Menu