[spfx-serve] The api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/ in SharePoint Framework

I will show you here how to fix the error – [spfx-serve] the api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/ that comes while developing an SPFx client-side web part.

the api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/

After developing an SPFx web part, when I ran the gulp serve command, it threw the error “[spfx-serve] The api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/ “.

Here is the error you can see the screenshot below:

the api entry could not be loaded node_modules/@microsoft/sp-webpart-workbench/lib/api/

To fix the above error, run the below command in the command prompt.

npm i @microsoft/sp-webpart-workbench

Once the command is successfully executed the error will not come.

[spfx-serve] The api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/

This is how to fix the error – [spfx-serve] the api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/ easily.

You may also like:

See also  SharePoint framework crud operations no javascript framework
>