SOLVED
Home

Error - Local gulp not found in project directory while running a spfx sample application

%3CLINGO-SUB%20id%3D%22lingo-sub-327436%22%20slang%3D%22en-US%22%3EError%20-%20Local%20gulp%20not%20found%20in%20project%20directory%20while%20running%20a%20spfx%20sample%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-327436%22%20slang%3D%22en-US%22%3E%3CP%3E%3CBR%20%2F%3EHi%3C%2FP%3E%3CP%3EI%20need%20some%20help%20in%20running%20a%20sample%20SharePoint%20Framework%20project.%3C%2FP%3E%3CP%3EIt%20used%20to%20be%20so%20easy%20to%20develop%20in%20Visual%20Studio%20since%20you%20only%20had%20to%20write%20some%20code%20but%20VS%20took%20care%20of%20everything%20else%20to%20build%20your%20application%20from%20your%20code.%20In%20SPFX%20you%20have%20to%20manage%20so%20many%20different%20tools%20with%20different%20versions%20that%20sometime%20it%20becomes%20overwhelming.%3C%2FP%3E%3CP%3EHere%20are%20the%20details%20of%20my%20environment.%3C%2FP%3E%3CP%3E1)%20Node.js%20v%208.11.4%3C%2FP%3E%3CP%3E2)%20spfx%20-%201.7.0%20(Sample%20application)%3C%2FP%3E%3CP%3E3)%20gulp%20CLI%20version%202.0.1%20(Global%20Install)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20done%20a%20%22npm%20install%22%20to%20install%20the%20dependencies%20for%20the%20project.%20However%20when%20I%20try%20to%20run%20the%20application%2C%20I%20get%20an%20error%20%22%20Local%20gulp%20not%20found%20in%20project%20dir%22.%20Try%20running%20%3A%20npm%20install%20gulp.%20I%20tried%20the%20suggested%20command%20%22npm%20install%20gulp%22%20to%20do%20the%20local%20install%20of%20the%20gulp%20even%20though%20I%20have%20the%20global%20install%20of%20the%20gulp.%20This%20did%20not%20help.%3C%2FP%3E%3CP%3EI%20looked%20at%20the%20node_modules%20in%20the%20VS%20code%20and%20I%20cannot%20decode%20it%20to%20understand%20if%20gulp%20is%20there%20in%20the%20local%20dependency%20list%20or%20not.%3C%2FP%3E%3CP%3EI%20have%20tried%20google%20and%20everyone%20has%20a%20different%20suggestion%20to%20solve%20this%20problem.%20Nothing%20seems%20to%20help.%3C%2FP%3E%3CP%3EIf%20someone%20can%20give%20me%20a%20tip%20or%20share%20their%20experience%2C%20I%20will%20really%20appreciate%20it.%3C%2FP%3E%3CP%3EThanks%20in%20advance%3C%2FP%3E%3CP%3E-Arun%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-327436%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-328678%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20-%20Local%20gulp%20not%20found%20in%20project%20directory%20while%20running%20a%20spfx%20sample%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-328678%22%20slang%3D%22en-US%22%3E%3CP%3EI%20had%20to%20delete%20the%20following%20files%20%3CSPAN%3Efrom%20the%20project%20folder%3CSPAN%3E%3CFONT%20face%3D%22Segoe%20UI%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FSPAN%3Efor%20%22npm%20install%22%20to%20work%20correctly%20to%20install%20the%20dependencies.%3C%2FP%3E%3CP%3E1)%20package-lock.json%2C%3C%2FP%3E%3CP%3E2)%20yarn.lock%20%26amp%3B%3C%2FP%3E%3CP%3E3)%20shrinkwrap.yarn%3C%2FP%3E%3CP%3EThanks%20to%20Andrew%20Connell%20for%20his%20advise.%20I%20tried%20everything%20what%20is%20available%20on%20the%20net%20and%20nothing%20helped.%20Hope%20it%20helps%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-327600%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20-%20Local%20gulp%20not%20found%20in%20project%20directory%20while%20running%20a%20spfx%20sample%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-327600%22%20slang%3D%22en-US%22%3ESorry%2C%20nothing%20other%20than%20checking%20if%20your%20machine%20is%20configured%20correctly.%3CBR%20%2F%3EHope%20this%20can%20help%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fset-up-your-development-environment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fset-up-your-development-environment%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-327531%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20-%20Local%20gulp%20not%20found%20in%20project%20directory%20while%20running%20a%20spfx%20sample%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-327531%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Joel%2C%20I%20tried%20deleting%20node_modules%20folder%20but%20it%20did%20not%20help%20%3A-(.%20Any%20more%20suggestions.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E-Arun%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-327470%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20-%20Local%20gulp%20not%20found%20in%20project%20directory%20while%20running%20a%20spfx%20sample%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-327470%22%20slang%3D%22en-US%22%3EHi%20Arun%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20would%20start%20by%20deleting%20the%20node_modules%20folder%20on%20the%20project%20and%20run%20npm%20install%20again.%20Ensure%20you%20do%20this%20in%20the%20project%20folder%20as%20well%20-%20I%20remember%20I%20did%20this%20mistake%20once%20as%20I%20had%202%20folders%20with%20almost%20identical%20names%20%3A)%3C%2Fimg%3E%3CBR%20%2F%3ESPFx%20has%20a%20dependency%20on%20gulp%2C%20so%20it%20should%20get%20installed%20when%20you%20run%20npm%20install%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps%2C%20but%20please%20reply%20with%20additional%20details%20if%20not%3CBR%20%2F%3E%3CBR%20%2F%3EJoel%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor


Hi

I need some help in running a sample SharePoint Framework project.

It used to be so easy to develop in Visual Studio since you only had to write some code but VS took care of everything else to build your application from your code. In SPFX you have to manage so many different tools with different versions that sometime it becomes overwhelming.

Here are the details of my environment.

1) Node.js v 8.11.4

2) spfx - 1.7.0 (Sample application)

3) gulp CLI version 2.0.1 (Global Install)

 

I have done a "npm install" to install the dependencies for the project. However when I try to run the application, I get an error " Local gulp not found in project dir". Try running : npm install gulp. I tried the suggested command "npm install gulp" to do the local install of the gulp even though I have the global install of the gulp. This did not help.

I looked at the node_modules in the VS code and I cannot decode it to understand if gulp is there in the local dependency list or not.

I have tried google and everyone has a different suggestion to solve this problem. Nothing seems to help.

If someone can give me a tip or share their experience, I will really appreciate it.

Thanks in advance

-Arun

4 Replies
Highlighted
Hi Arun,

I would start by deleting the node_modules folder on the project and run npm install again. Ensure you do this in the project folder as well - I remember I did this mistake once as I had 2 folders with almost identical names :)
SPFx has a dependency on gulp, so it should get installed when you run npm install

Hope this helps, but please reply with additional details if not

Joel
Highlighted

Hi Joel, I tried deleting node_modules folder but it did not help :-(. Any more suggestions.

Thanks

-Arun

 

Highlighted
Highlighted
Solution

I had to delete the following files from the project folder for "npm install" to work correctly to install the dependencies.

1) package-lock.json,

2) yarn.lock &

3) shrinkwrap.yarn

Thanks to Andrew Connell for his advise. I tried everything what is available on the net and nothing helped. Hope it helps you.