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.
I just encountered this on Windows 10 and the latest NodeJS (14.15.1). In my case our admins have our profiles and true "home" folder remotely mount onto our work machine(s). Npm wanted to put its cache over on the remote server and that has worked until this release.
I was unaware that npm has a .npmrc
file available. I added one to my actual machine's C:\Users\my-id
folder and it contains:
prefix=C:\Users\my-id\nodejs\npm
cache=c:\Users\my-id\nodejs\npm-cache
I also added these paths to my PATH
environment variable.
I went to the APPDATA
folder on my work machine and the remote "home" server and deleted all the npm related Roaming folders. I deleted the node_modules
folder in my project.
I closed all open windows and reopened them. I brought up a command prompt in my project dir and re init
ed npm and reinstalled the modules I wanted.
After that everything is rolling along.
The best solution, you can manage the multiple node versions using nvm installer. then, install the required node's version using below command
nvm install version
Use below command as a working node with mentioned version alone
nvm use version
now, you can use any version node without uninstalling previous installed node.
I had similar issue when I installed locally initially(w/o -g). I reinstalled with -g (global) and then it worked.
npm install -g gulp
you should run gulp from folder where gulpfile.js
is available.
In my case, this problem occured because I did npm install
with another system user in my project folder before. Gulp was already installed globally. After deleting folder /node_modules/ in my project, and running npm install
with the current user, it worked.
If you have mysql install in your windows 10 try uninstall every myqsl app from your computer. Its work for me. exactly when i installed the mysql in my computer gulp command and some other commands stop working and then i have tried everything but not nothing worked for me.