SPfx Issues Using Gulp Serve

Copper Contributor

Hello, 

I am currently using SharePoint Framework version 1.13.1, Node version 14.15.0, npm version 6.14.8, and gulp-cli version 2.3.0.

 

I have created a webpart using the yeoman sharepoint generator, updated the serve.json file to reflect our SPO url and (I believe) installed every necessary dependency for Gulp. However, when I run npm gulp serve, I get no output at all and nothing happens. I leave it running for a while, just to see if anything ever happens but nothing ever comes up. I end up having to just break the command. Is there any reason for this?

7 Replies

@JordanWall the problem might be the command "npm gulp serve"

 

Leave the npm out and just try "gulp serve"

 

 

Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Hello Don,
I apologize, that was a typo in my posting. I run 'gulp serve' and have even run 'gulp serve --no-browser'.

@JordanWall I am not sur what is happening, since I have seen gulp serve return errors, or be very slow to start the first time, but have never seen it freeze.  I would start with environment.

 

I have a blog post that covers how to quickly set up environment, so you might check there to see if you missed anything. https://www.donkirkham.com/blog/spfx2022/ 

 

If you are using nvm, I would create a new environment with the following commands.

nvm install 14.9.0
nvm use 14.9.0
npm install gulp-cli yo @microsoft/generator-sharepoint -g

From there, change to your current project folder and execute the following

npm i -force
gulp serve --nobrowser

IF that doesn't work, try 

gulp build

If that doesn't work, try creating a new solution and execute 

yo @microsoft/sharepoint
gulp serve --nobrowser

 

I hope this helps but troubleshooting these types of problem in the forum can be challenging.

 

Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@Don Kirkham Thank you Don, I am still working on the issue so I will definitely try these suggestions. 

 

I greatly appreciate it!

Hey @JordanWall. Did you find a resolution or cause for this? I'm running into the same thing.

@jsmileyb 

 

This was a while back, however, I believe my issue was I was not running node locally. I had node installed on a sharedrive (company requirements) and was trying to run and access code that was not stored on my local drive. Once I moved node and my files onto my C: drive, this fixed most of my issues

@JordanWall

DANG!...I was hoping for new insight on this. All good and happy you got it working. Thanks for responding.