简体   繁体   中英

Gulp throwing error: File not found with singular glob

After renaming my file I am getting the following error when running the gulp build task:

Error: Error: File not found with singular glob: F:\Projects\xyz\HTML\app\css\main.css
    at DestroyableTransform.<anonymous> (F:\Projects\xyz\HTML\node_modules\gulp-useref\lib\streamManager.js:90:36)

main.css file no longer exists as I changed it to style.css but for some reason it is searching for the old file.

As it turns out I missed changing file name in HTML file as it was calling main.css instead of style.css.

<!--build:css css/main.min.css -->
<link rel="stylesheet" href="css/main.css">
<!-- endbuild -->

Changed it to:

<!--build:css css/style.min.css -->
<link rel="stylesheet" href="css/style.css">
<!-- endbuild -->

An honest mistake but I believe someone else can run into something similar :)

In my case, removing these files:

  • package-lock.json
  • node_modules folder
  • any .tmp or dist folder

And then reinstall dependencies using:

npm i

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM