The first step:
1 determine first. Whether the bash_profile exists.
2 in Mac terminal input:
Test-e. Bash_profile && echo "Found" | | echo "Not Found"
3.bash_profile is an environment-configured script that runs at the terminal if not found is displayed
Touch ~/.bash_profile
Repeat 2 after running, display found, indicates the creation is successful
Step Two:
1 Installing GRUNT-CLI
sudo npm install-g grunt-cli
2 Open the. bash_profile file in the first step in the form of a command, with the following command:
Open-a TextEdit ~/.bash_profile
3 Write the environment configuration to the. Bash_profile you opened, then save the ctrl+s, then exit, note that the path is different for each person, to see their own GRUNT-CLI installation road path is not valid for error
Export Path=/usr/local/cellar/node/6.7.0/libexec/npm/lib/node_modules/grunt-cli/bin: $PATH
Step Three:
1 running at Terminal: Source ~/.bash_profile
2 running at Terminal: Grunt--version
If it works, you'll see the version number of the GRUNT-CLI.
END
Troubleshooting "Command not Found" error when installing Grunt on Mac