''gulp' not working getting a MODULE_NOT_FOUND error, but npm run watch" works and helps compressing my css

So I installed this theme starter for Wordpress which included gulp + webpack configuration. I am new to gulp and webpack.I am kind of new to gulp and webpack. Once I installed the theme on my wordpress site I follow the instruction which where:

Open the Project directory / in Terminal and install the required Node.js dependencies: gulp, webpack, Sass-Compiler, Autoprefixer, etc.

  • $ npm install
  • Run the watch script
  • $ npm run watch

I learned a little bit of gulp and I trying to putting in practice with this new project but for some reason when I run gulpor gulp watch I get the following error:

throw err;
Error: Cannot find module 'gulp-cli'
Require stack:
- /usr/share/nodejs/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/share/nodejs/gulp/bin/gulp.js:3:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/share/nodejs/gulp/bin/gulp.js' ]

I am able though to compress all my scss and js by running npm run watch. I am just trying to understand why I am not able to use normal gulp commands in this project?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source