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
Similar Posts:
- nvm is not compatible with the npm config prefix option:
- NPM Install vue-cli Error: internal/modules/cjs/loader.js (Error: Cannot find module ‘D:\Program\nodejs\node_global\node_modules\vue-cli\bin\vue’)
- gulp Cannot read property ‘apply’ of undefined
- Error: exec npm config get prefix ERROR: Command failed: npm config get prefix [How to Solve]
- Local workspace file (‘angular.json’) could not be found.
- Failed to install node with. MSI, rolling back action (Reprint)
- [Solved] NPM installation error: error: eacces: permission denied
- GulpThe following tasks did not complete [How to Solve]
- NPM install socket.io[UNK][UNK] error: [UNK](npm WARN enoent ENOENT: no such file or directory, open ‘/usr/local/no…
- [Solved] NPM run dev error [npm ERR! code ELIFECYCLE]