SPFX unreserve ports Node.js

g h 716 Reputation points
2021-04-26T07:40:59.127+00:00

I am using SharePoint framework webpart and the default port for workbench is 4321, for another webpart developing the port is reserved and the workbench page is cant reach, I changed the port to 4322 for example, but how we can unreserved the default port?

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,576 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,566 Reputation points
    2021-04-27T01:58:49.17+00:00

    Hi @g h ,

    The port for SPFX WebPart is denified in config->serve.json, you can change to the default port there:

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",  
      "port": 4321,  
      "https": true,  
      "initialPage": "https://localhost:5432/workbench",  
      "api": {  
        "port": 5432,  
        "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"  
      }  
    }  
    

    91475-ti0ix.png

    Thanks
    Best Regards


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful