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

后端 未结 11 1993
生来不讨喜
生来不讨喜 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.

提交回复
热议问题