1

I have downloaded the spfx samples from github and I am running into this problem when I execute gulp serve.

λ gulp serve
[12:39:37] Local gulp not found in C:\react-todo-basic
[12:39:37] Try running: npm install gulp

I used this to install gulp:

npm install --save-dev gulp-install

but still getting the same error.

then I ran

npm install

then ran gulp serve again and started getting strange errors:

C:\react-todo-basic                                                                                              
λ gulp serve                                                                                                              
Build target: DEBUG                                                                                                       
[12:56:27] Using gulpfile C:\Projects\react-todo-basic\gulpfile.js                                                        
TypeError: Cannot read property 'apply' of undefined                                                                      
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20                                    
    at _combinedTickCallback (internal/process/next_tick.js:131:7)                                                        
    at process._tickCallback (internal/process/next_tick.js:180:9)                                                        
    at Function.Module.runMain (module.js:686:11)                                                                         
    at startup (bootstrap_node.js:187:16)                                                                                 
    at bootstrap_node.js:608:3                                                                                            
[12:56:27] Error - Unknown                                                                                                
 Cannot read property 'apply' of undefined                                                                                
[12:56:28] ==================[ Finished ]==================                                                               
Error - Unknown                                                                                                           
 Cannot read property 'apply' of undefined                                                                                
[12:56:28] Project react-todo-basic version: 0.0.3                                                                        
[12:56:28] Build tools version: 2.5.3                                                                                     
[12:56:28] Node version: v8.9.4                                                                                           
[12:56:28] Total duration: 2.7 s                                                                                          
[12:56:28] Task errors: 2                                                                                                 
TypeError: localCache.gulp.stop is not a function                                                                         
    at C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:253:37                         
    at C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:192:21                         
    at C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:133:13                         
    at Timeout._onTimeout (C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:114:17)    
    at ontimeout (timers.js:475:11)                                                                                       
    at tryOnTimeout (timers.js:310:5)                                                                                     
    at Timer.listOnTimeout (timers.js:270:5)                                                                              
[12:56:28] Error - Unknown                                                                                                
 localCache.gulp.stop is not a function                                                                                   
C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:253                                   
                    localCache.gulp.stop();                                                                               
                                    ^                                                                                     

TypeError: localCache.gulp.stop is not a function                                                                         
    at C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:253:37                         
    at writeSummary (C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:202:13)          
    at process.<anonymous> (C:\react-todo-basic\node_modules\@microsoft\gulp-core-build\lib\logging.js:250:13)   
    at emitOne (events.js:116:13)                                                                                         
    at process.emit (events.js:211:7)                                                                                     
    at process._fatalException (bootstrap_node.js:374:26)                                                                 

C:\react-todo-basic                                                                                              
λ         
1

Try running

npm install --save-dev gulp

instead of

npm install --save-dev gulp-install
  • I think I have tried both options, but I will give a try and let you know. – Burre Ifort May 25 '18 at 8:34
0

Your current directory C:\react-todo-basic does not contain a gulpfile. Your probably have your project in a folder beneath it.

So, CD into that folder and run your gulp task.

  • the gulp file is in the same folder as my project. – Burre Ifort May 25 '18 at 8:34
  • at this moment I created a new project from scratch and copied the files there. I will continue investigating this issue, though. – Burre Ifort May 25 '18 at 8:35
0

Run : npm link gulp in your application directory (to create a local link to the globally installed Gulp module)

0

Hi here you go this should work, after you run bellow command:

Step-1:

npm install @microsoft/generator-sharepoint --save-dev

you should run the following command:

Step-2:

yo @microsoft/sharepoint

Step-3:

gulp trust-dev-cert 

Make sure you allow access when popups come

step-5:

gulp serve
0

Run cmd as Admin on your PC, so that the Popup comes up to Allow access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.