'gulp' is not recognized as an internal or external command

后端 未结 11 2029
生来不讨喜
生来不讨喜 2021-02-03 17:03

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.

  1. I installed
相关标签:
11条回答
  • 2021-02-03 17:43

    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 inited npm and reinstalled the modules I wanted.

    After that everything is rolling along.

    0 讨论(0)
  • 2021-02-03 17:45

    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.

    0 讨论(0)
  • 2021-02-03 17:47

    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.

    0 讨论(0)
  • 2021-02-03 17:50

    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.

    0 讨论(0)
  • 2021-02-03 17:54

    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.

    0 讨论(0)
提交回复
热议问题