gulpjs / gulp-util

[deprecated] - See https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error cannot find gulp-util after attempting to fix assertion issue

codewizard13 opened this issue · comments

NOTE: This is a continuation of my original ticket (#152), which is not yet resolved, and was prematurely closed, either automatically by the system or manually by @stevelacy who was helping me. Since I am unable to re-open the ticket, I guess here I am creating a new one.


Unclear Tasks and Missing Video

@stevelacy said (in the previous ticket #152):

The error states exactly what the issue is: AssertionError [ERR_ASSERTION]: Task function must be specified
Tasks are not specified.
You need to add a task to the gulpfile.js
Just add a task to you gulpfile.js such as one of the many in the Getting started guide

@stevelacy I checked out the getting started guide but did not see any video, and I don't need any recipes, (I don't think). I just want gulp to not break when I'm trying to follow this tutorial. Gulp looks like a useful tool, but I am not supposed to have to understand a deep-dive into it right now, I'm just following along with a tutorial. I have no idea what recipe I might need, if any.

Also, can you clarify where the video you are referencing is? I would love to watch it, but it is not on the link you provided. Here is what that "getting started guide" page looked like today (May 24, 2018):

ehscreenshot_2018 05 24_code_dgithubpost_gulputilassertiondeprecated_01

As you can see, there is no video on this page.

Can't Find Gulp-Util

Now am getting an error:

 Error: Cannot find module 'gulp-util'

If gulp-util is what is giving me the problem, and it is deprecated as referenced above, um ... where do I go from here?

The Repo I'm Using

If it helps to reproduce the error, this is the repository I am using: https://github.com/planetoftheweb/responsivebootstrap

Steps to Reproduce

NOTE: I'm using Windows so I'll give the instructions presuming Git Bash and node are installed already.

  1. Create a master git folder in root:

    mkdir /c/git_main

  2. CD into git_main

    cd /c/git_main

  3. Type git init to create the .git hidden folder.

  4. Download the responsivebootstrap git repo to local hard drive:

    git clone https://github.com/planetoftheweb/responsivebootstrap.git

  5. CD into new responsivebootstrap folder.

  6. Type git init and hit enter to initialize the downloaded repo for logging etc.

  7. Since gulp 3 has been replaced by a new verson called "gulp-cli" remove any previously existing version of gulp:

    npm rm --global gulp

  8. Install the new gulp command line interface globally (meaning you don't have to install it in the root directory. You can install it from anywere and it will be available everywhere:

    npm install --global gulp-cli

    (This may be the same as npm install gulp-cli -g, but that is unclear)

  9. Run npm install gulp -D (for some reason), as indicated here: https://gulpjs.com/

ehscreenshot_2018 05 23_code_gulpjsnpmerrorinstall_01

https://i.imgur.com/kV7DtjP.png

  1. Run touch gulpfile.js.

  2. Run gulp.

  3. Get error:

module.js:549
    throw err;
    ^

Error: Cannot find module 'gulp-util'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\ehw_git_repo\responsivebootstrap\gulpfile.js:2:13)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

To be clear, I didn't enter any command that had gulp-util in the name ... that phrase never came from my fingers.

Thanks again for all your help so far.

@codewizard13 the video @stevelacy mentioned is the one that you referred to in your original post. It shows how to install nodejs and goes into details about what each step on the gulp website does. He even says not to worry about the deprecation warnings that show up when you install gulp.

It seems like you're trying to follow different tutorials and missing some steps or adding unnecessary steps. At the bottom of the responsivebootstrap readme, it shows how to install that repository, and one of the steps is to run npm install in the directory after cloning it from GitHub. This step will install any dependencies that that repository is using (one of them is gulp-util). This repository already has a gulpfile.js which means that the touch gulpfile.js step is not necessary.

Since this is not an issue with gulp-util or gulp please direct all support related questions to Stack Overflow

@doowb said it perfectly. To assist farther please read articles on npm, git, node, and introductions to using the cli.

git clone git@github.com:planetoftheweb/responsivebootstrap.git
cd responsivebootstrap
npm install
gulp