07-21-2023, 02:44 PM
I am trying to use [Gulp][1] and [Node.Js][2] to stream my process for minifying and concatenating CSS/JS files for production.
Here is what I have done.
1. I installed [Node.Js][2] on my Windows 7 machine.
2. Installed Gulp globally using this command `npm install -g gulp`
3. Then I added a new User variable called `NODE_PATH` set it to `%AppData%\npm\node_modules`
After closing and re-opening my command line, I tried to run a gulp task from the command line (i.e. `gulp css`). But that give me the following error
'gulp' is not recognized as an internal or external command
How can I get this to work?
When I opened the following path using the search bar in windows,
`%AppData%\npm\node_modules` I see the following two folders
gulp
gulp-cli
[![enter image description here][3]][3]
I've tried to add `%AppData%\npm\node_modules` to the `Path` variable on my system variable, but it did not take it because that variable reached it's max allowed character limit.
I removed couple of paths from my `Path` variable and added `;C:\Users\[MyWindowsUserName]\AppData\Roaming\npm\node_modules`
but still not working.
I even tried to set the path at run time using this command
`PATH=%PATH%;C:\Users\[MyWindowsUserName]\AppData\Roaming\npm\node_modules`
then run `gulp` and still the same issues.
What am I missing here? What else do I need in order to get this to work?
[1]:
Here is what I have done.
1. I installed [Node.Js][2] on my Windows 7 machine.
2. Installed Gulp globally using this command `npm install -g gulp`
3. Then I added a new User variable called `NODE_PATH` set it to `%AppData%\npm\node_modules`
After closing and re-opening my command line, I tried to run a gulp task from the command line (i.e. `gulp css`). But that give me the following error
'gulp' is not recognized as an internal or external command
How can I get this to work?
When I opened the following path using the search bar in windows,
`%AppData%\npm\node_modules` I see the following two folders
gulp
gulp-cli
[![enter image description here][3]][3]
I've tried to add `%AppData%\npm\node_modules` to the `Path` variable on my system variable, but it did not take it because that variable reached it's max allowed character limit.
I removed couple of paths from my `Path` variable and added `;C:\Users\[MyWindowsUserName]\AppData\Roaming\npm\node_modules`
but still not working.
I even tried to set the path at run time using this command
`PATH=%PATH%;C:\Users\[MyWindowsUserName]\AppData\Roaming\npm\node_modules`
then run `gulp` and still the same issues.
What am I missing here? What else do I need in order to get this to work?
[1]:
[To see links please register here]
[2]:[To see links please register here]
[3]: