Tag Archives: command not found error fix

Mac opens Terminal and reports an error -bash:: command not found

Problem Description:  

When opening Terminal on Mac system, an error -bash:: command not found was reported.

problem analysis:

The error does not affect the use of Terminal, so it is ignored. But after modifying the .bash_profile file, in order to make the configuration effective, using the source command also reported an error -bash:: command not found.

At first I thought it was because the source command could not be found, and I added /bin to the environment variable, but still reported this error.

The problem is in trouble.

Searching on the Internet, I found that most of the problems are similar to -bash:nginx: command not found, that is to say, there is a command between the two ::, but the specific command cannot be found. But the current error report did not see this command, but a space, which means that the space is also regarded as a command, which means that a space is written in .bash_profile, which is considered as a command to be executed by the system.

Open .bash_profile, and no spaces are seen. Copy the contents of the file to a text editor, and no spaces are seen.

In order to troubleshoot, I plan to comment out all the commands, let go of the commands line by line, and then execute the source command to see which line is reporting the error. Found that the workload is too large.

I accidentally opened .bash_profile with VS Code, and found an exception, as follows:

Remove this special character, source again, and no more errors will be reported.

It can be seen that the system executes this special character as a command, but cannot find this command, and this command is displayed as a space in the terminal, which leads to the above error.

Mac error: SH: Vue cli service: command not found

An error below: sh: vue - cli - service: command not found

solution:
terminal execute the command

#clear cache
npm cache clean --force   
#reinstall
npm/cnpm  install

Another online article roughly said 3 solutions
1. Reinstall the
delete folder node_modules in carrying out NPM/CNPM install to install
2. Specify the path
./node_modules/.bin/vue-cli-service build
3. Global installation
npm install @vue/cli-service -g
NODE_ENV=production
Try a few times more, if other reasons can refer to https://stackoverflow.com/questions/51172064/command-not-found-with-vue-cli