3

SPFX webpart created successfully but when I run gulp serve command I get error.

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

-- Node.js command prompt out put

[12:19:56] Starting subtask 'write-manifests'...
[12:19:56] Finished subtask 'write-manifests' after 334 ms
[12:19:56] Starting subtask 'serve'...
[12:19:57] Error - [serve] The api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/
[12:19:57] Finished subtask 'serve' after 409 ms
[12:19:57] Finished 'serve' after 5.66 s
[12:19:57] Server started https://localhost:4321
[12:19:57] LiveReload started on port 35729
[12:19:57] Opening https://localhost:5432/workbench using the default OS app
[12:19:57] ==================[ Finished ]==================
Error - [serve] The api entry could not be loaded: node_modules/@microsoft/sp-webpart-workbench/lib/api/
[12:19:58] Project test version: 0.0.1
[12:19:58] Build tools version: 2.5.3
[12:19:58] Node version: v6.11.0
[12:19:58] Total duration: 8.68 s
[12:19:58] Task errors: 1

3

I got a answer from here

Run this command

npm i @microsoft/sp-webpart-workbench

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.