Why are there a series of technical challenges behind “OMG buy it”>>>
When using the gulp server
command, bash: gulp: command not found
appears
first of all, when I saw this command, I doubted that my gulp was not installed properly. I executed it again NPM install - G gulp
, but the command ran smoothly, and the result still appeared: bash: gulp: command not found
then I found the following article on the Internet
I feel that the direction to solve the problem is right. The command of gulp is invalid. It should be the configuration problem. Then I go to the global directory (C: program files/nodejsnode)_ modules/npm/node_ Modules) to see if my gulp package is installed, and it is not! My bag succeeded, but it was in the wrong place
1. Use the command to check: NPM config get prefix
, and the following figure is obtained
looking at the location, it seems that it is the address that I configured when I used the lower version of node.. But now NPM has been integrated into node. I can’t find the configuration address myself. Anyway, there is absolutely no environment variable. Now I just want to correct the address and go to the new path I follow C:// program files/nodejs/node_ modules\npm
。
2. Use the command to modify the configuration
npm config set prefix C:\Program Files\nodejs\node_ As we all know, the file name of the program files in the middle is very hollow, which causes the command to be interrupted in this way. So I went to the configuration file to modify it manually (this is a simple and direct way). The file location is here
C:// users/administrator
(see the figure below)
3. Check the configuration of NPM again
as can be seen from the above figure, the configuration address now points to NPM in node, and then install gulp to see
running commands: NPM install - G gulp
and gulp - V