Gulp cannot read property apply of undefined

Questions : cannot read property apply of undefined gulp

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00

937

I am trying to use the ng-factory generator anycodings_gulp-sass to scaffold a new project to build an anycodings_gulp-sass angularjs component. After the project has anycodings_gulp-sass been created with the yo ng-factory command, anycodings_gulp-sass I tried to run it using the gulp serve task anycodings_gulp-sass 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 anycodings_gulp-sass undefined at C:\Users\ATUL anycodings_gulp-sass KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129: anycodings_gulp-sass 19 at _combinedTickCallback anycodings_gulp-sass (internal/process/next_tick.js:67:7) at anycodings_gulp-sass process._tickCallback anycodings_gulp-sass (internal/process/next_tick.js:98:9) at anycodings_gulp-sass Module.runMain (module.js:577:11) at run anycodings_gulp-sass (bootstrap_node.js:352:7) at startup anycodings_gulp-sass (bootstrap_node.js:144:9) at anycodings_gulp-sass bootstrap_node.js:467:3

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

Thanks, Atul Kale

Total Answers 8

28

Answers 1 : of cannot read property apply of undefined gulp

Try to reinstall gulp-cli :

npm install -g gulp-cli

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

mRahman

1

Answers 2 : of cannot read property apply of undefined gulp

npm install -g gulp-cli

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

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

joy

4

Answers 3 : of cannot read property apply of undefined gulp

Upgrade to 4.0 like this:

npm install --save-dev github:gulpjs/gulp#4.0 

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

raja

3

Answers 4 : of cannot read property apply of undefined gulp

Uninstall the global gulp installation anycodings_angularjs and local gulp-cli installation. While anycodings_angularjs keeping global gulp-cli and local gulp anycodings_angularjs packages.

npm uninstall -g gulp
npm uninstall -g gulp-cli

npm install -g gulp-cli
npm install --save-dev github:gulpjs/gulp#4.0 

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

raja

1

Answers 5 : of cannot read property apply of undefined gulp

I get below error everytime i run

npm install gulp -g --save

TypeError: Cannot read property 'apply' anycodings_angularjs of undefined

at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)

I tried:

npm i -g gulp-cli

and it works for me.

If again i run

npm install gulp -g --save

the above error returns. I noted when i anycodings_angularjs first installed Gulp it was saved in my anycodings_angularjs package.json but now it's absent.

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

raja

2

Answers 6 : of cannot read property apply of undefined gulp

I tried uninstalling both gulp and anycodings_angularjs gulp-cli from my machine (locally and anycodings_angularjs globally), but after uninstall gulp -v, anycodings_angularjs it still showed Gulp CLI 3.9.1, even in anycodings_angularjs new terminal window. In the end, these anycodings_angularjs are the steps that finally worked for me anycodings_angularjs (seems like CLI simply got cached hard):

  1. Navigate to your project and delete anycodings_angularjs node_modules folder.

  2. Run following:

npm uninstall gulp --global
npm uninstall gulp-cli --global
apt-get remove npm
apt-get remove nodejs
apt-get install nodejs
apt-get install npm
npm install --global gulp-cli
  1. Navigate to your project and run: npm anycodings_angularjs install

  2. Close current terminal, open new one and anycodings_angularjs check for success: gulp -v

Should say CLI version 2.1.0 (as of time anycodings_angularjs of writing).

Now you can run your gulp tasks without anycodings_angularjs that error :)

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

jidam

5

Answers 7 : of cannot read property apply of undefined gulp

In my case, I had an automated script anycodings_angularjs which was doing npm install gulp (...) anycodings_angularjs and until v3.9x it was fine.

After some time, that naive install anycodings_angularjs would pick v4.0.0, which breaks my CI.

Changing the script to do npm install anycodings_angularjs reverted things back to anycodings_angularjs normal.

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

jidam

6

Answers 8 : of cannot read property apply of undefined gulp

Reinstall gulp and gulp-cli, to install anycodings_angularjs the last version.

npm uninstall -g gulp
npm uninstall -g gulp-cli

npm install -g gulp-cli
npm install -g gulp

And then, close the terminal and open anycodings_angularjs new.

*This command no longer works: npm anycodings_angularjs install --save-dev anycodings_angularjs github:gulpjs/gulp#4.0

0

2022-09-23T19:03:59+00:00 2022-09-23T19:03:59+00:00Answer Link

raja