I am trying to use Gulp and Node.Js to stream my process for minifying and concatenating CSS/JS files for production.
Here is what I have done.
Go to My Computer>Properties>Advance System Settings>Environment Variables>
Under the variables of Administrator edit the PATH variable & change its value to "C:\Users\Username\AppData\Roaming\npm"
. Note: The username in the path will be the current Admin user's name that you have logged in with.
I solved the problem by uninstalling NodeJs and gulp then re-installing both again.
To install gulp globally I executed the following command
npm install -g gulp
I was having the same exception with node v12.13.1,
Downgraded node to v10.15.3 and it works fine now.
Sorry that was a typo. You can either add node_modules to the end of your user's global path variable, or maybe check the permissions associated with that folder (node _modules). The error doesn't seem like the last case, but I've encountered problems similar to yours. I find the first solution enough for most cases. Just go to environment variables and add the path to node_modules to the last part of your user's path variable. Note I'm saying user and not system.
Just add a semicolon to the end of the variable declaration and add the static path to your node_module folder. ( Ex c:\path\to\node_module)
Alternatively you could:
In your CMD
PATH=%PATH%;C:\\path\to\node_module
EDIT
The last solution will work as long as you don't close your CMD. So, use the first solution for a permanent change.
You need to make sure, when you run command (install npm -g gulp), it will create install gulp on C:\ directory.
that directory should match with whatver npm path variable set in your java path.
just run path from command prompt, and verify this. if not, change your java class path variable wherever you gulp is instaled.
It should work.
I had the same problem on windows 7. You must edit your path system variable manually.
Go to START -> edit the system environment variables -> Environment variables -> in system part find variables "Path" -> edit -> add new path after ";" to your file gulp.cmd directory some like ';C:\Users\YOURUSERNAME\AppData\Roaming\npm' -> click ok and close these windows -> restart your CLI -> enjoy