Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot read property 'apply' of undefined gulp

I am trying to use the ng-factory generator to scaffold a new project to build an angularjs component. After the project has been created with the yo ng-factory command, I tried to run it using the gulp serve task but found the following error:

c:\projects\bywebclient>gulp serve [11:20:51] Loading C:\projects\bywebclient\gulp_tasks\browsersync.js [11:20:52] Loading C:\projects\bywebclient\gulp_tasks\karma.js [11:20:57] Loading C:\projects\bywebclient\gulp_tasks\misc.js [11:20:57] Loading C:\projects\bywebclient\gulp_tasks\webpack.js [11:21:07] Using gulpfile c:\projects\bywebclient\gulpfile.js C:\Users\ATUL KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129 gulpInst.start.apply(gulpInst, toRun); 

^

TypeError: Cannot read property 'apply' of undefined
at C:\Users\ATUL KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129: 19

at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3

Am I missing something? I already tried to run again the npm install

Thanks, Atul Kale

like image 568
atul kale Avatar asked Aug 02 '16 12:08

atul kale


People also ask

How do I know if gulp is installed?

First run npm -g install gulp-cli then run gulp -v. Alternatively, you can just run npm list gulp.

Can not find module gulp?

Install the gulp-sass module manually If you don't see the gulp-sass package in your node_modules folder, or are still having issues, you can try reinstalling the package. First, open your package. json and package-lock. json files and remove any references to gulp-sass and node-sass that you see.


2 Answers

Try to reinstall gulp-cli :

npm install -g gulp-cli 
like image 95
Davide Castronovo Avatar answered Nov 11 '22 19:11

Davide Castronovo


npm install -g gulp-cli 

And important: after running that command, open a new terminal so it'll take effect.

like image 22
ofirbt Avatar answered Nov 11 '22 19:11

ofirbt