0

I want to create an SPFx web part, so i run these commands:-

yo @microsoft/sharepoint
gulp serve

then when i try to run gulp serve, i got this error:-

Cannot GET /temp/workbench.html

enter image description here

here is the list of components modules that i have:-

C:\WINDOWS\system32>npm ls -g --depth=0
C:\Users\mohan\AppData\Roaming\npm
+-- @microsoft/generator-sharepoint@1.13.0
+-- gulp-cli@2.3.0
`-- yo@4.3.0

&

Your environment has been set up for using Node.js 14.18.1 (x64) and npm.

C:\Windows\System32>npm list --global
C:\Users\mohan\AppData\Roaming\npm
+-- @microsoft/generator-sharepoint@1.13.0
| +-- @microsoft/spfx-heft-plugins@1.13.0
| | +-- @azure/storage-blob@12.4.1
| | | +-- @azure/abort-controller@1.0.4
| | | | `-- tslib@2.3.1 deduped
| | | +-- @azure/core-http@1.2.6
| | | | +-- @azure/abort-controller@1.0.4 deduped
| | | | +-- @azure/core-asynciterator-polyfill@1.0.0
| | | | +-- @azure/core-auth@1.3.2
| | | | | +-- @azure/abort-controller@1.0.4 deduped
| | | | | `-- tslib@2.3.1 deduped
| | | | +-- @azure/core-tracing@1.0.0-preview.11
| | | | | +-- @opencensus/web-types@0.0.7 deduped
| | | | | +-- @opentelemetry/api@1.0.0-rc.0
| | | | | `-- tslib@2.3.1 deduped
| | | | +-- @azure/logger@1.0.3 deduped
| | | | +-- @types/node-fetch@2.5.12
| | | | | +-- @types/node@16.11.7
| | | | | `-- form-data@3.0.1 deduped
| | | | +-- @types/tunnel@0.0.1
| | | | | `-- @types/node@16.11.7 deduped
| | | | +-- form-data@3.0.1
| | | | | +-- asynckit@0.4.0
| | | | | +-- combined-stream@1.0.8 deduped
| | | | | `-- mime-types@2.1.34 deduped
| | | | +-- node-fetch@2.6.6 deduped
| | | | +-- process@0.11.10
| | | | +-- tough-cookie@4.0.0
| | | | | +-- psl@1.8.0
| | | | | +-- punycode@2.1.1
| | | | | `-- universalify@0.1.2 deduped
| | | | +-- tslib@2.3.1 deduped
| | | | +-- tunnel@0.0.6
| | | | +-- uuid@8.3.2
| | | | `-- xml2js@0.4.23
| | | |   +-- sax@1.2.4 deduped
| | | |   `-- xmlbuilder@11.0.1
| | | +-- @azure/core-lro@1.0.5
| | | | +-- @azure/abort-controller@1.0.4 deduped
| | | | +-- @azure/core-http@1.2.6 deduped
| | | | +-- @azure/core-tracing@1.0.0-preview.11
| | | | | +-- @opencensus/web-types@0.0.7 deduped
| | | | | +-- @opentelemetry/api@1.0.0-rc.0
| | | | | `-- tslib@2.3.1 deduped
| | | | +-- events@3.3.0 deduped
| | | | `-- tslib@2.3.1 deduped
| | | +-- @azure/core-paging@1.2.0
| | | | +-- @azure/core-asynciterator-polyfill@1.0.0 deduped
| | | | `-- tslib@2.3.1 deduped
| | | +-- @azure/core-tracing@1.0.0-preview.9
| | | | +-- @opencensus/web-types@0.0.7
| | | | +-- @opentelemetry/api@0.10.2 deduped
| | | | `-- tslib@2.3.1 deduped
| | | +-- @azure/logger@1.0.3
| | | | `-- tslib@2.3.1 deduped
| | | +-- @opentelemetry/api@0.10.2
| | | | `-- @opentelemetry/context-base@0.10.2
| | | +-- events@3.3.0
| | | `-- tslib@2.3.1
| | +-- @microsoft/hashed-folder-copy-plugin@1.13.0
| | | +-- @rushstack/node-core-library@3.40.0 deduped
| | | `-- glob@7.0.6 deduped
| | +-- @microsoft/loader-load-themed-styles@1.9.89
| | | +-- @microsoft/load-themed-styles@1.10.208
| | | `-- loader-utils@1.1.0
| | |   +-- big.js@3.2.0
| | |   +-- emojis-list@2.1.0
| | |   `-- json5@0.5.1
| | +-- @microsoft/rush-lib@5.52.0
| | | +-- @azure/identity@1.0.3
| | | | +-- @azure/core-http@1.2.6 deduped
| | | | +-- @azure/core-tracing@1.0.0-preview.7
| | | | | +-- @opencensus/web-types@0.0.7 deduped
| | | | | +-- @opentelemetry/types@0.2.0 deduped
| | | | | `-- tslib@1.14.1 deduped
| | | | +-- @azure/logger@1.0.3 deduped
| | | | +-- @opentelemetry/types@0.2.0
| | | | +-- events@3.3.0 deduped
| | | | +-- jws@3.2.2
| | | | | +-- jwa@1.4.1
| | | | | | +-- buffer-equal-constant-time@1.0.1
| | | | | | +-- ecdsa-sig-formatter@1.0.11
| | | | | | | `-- safe-buffer@5.2.1 deduped
| | | | | | `-- safe-buffer@5.2.1 deduped
| | | | | `-- safe-buffer@5.2.1 deduped
| | | | +-- msal@1.4.15
| | | | | `-- tslib@1.14.1
| | | | +-- qs@6.10.1
| | | | | `-- side-channel@1.0.4
| | | | |   +-- call-bind@1.0.2
| | | | |   | +-- function-bind@1.1.1 deduped
| | | | |   | `-- get-intrinsic@1.1.1 deduped
| | | | |   +-- get-intrinsic@1.1.1
| | | | |   | +-- function-bind@1.1.1 deduped
| | | | |   | +-- has@1.0.3 deduped
| | | | |   | `-- has-symbols@1.0.2
| | | | |   `-- object-inspect@1.11.0
| | | | +-- tslib@1.14.1
| | | | `-- uuid@3.4.0
| | | +-- @azure/storage-blob@12.3.0
| | | | +-- @azure/abort-controller@1.0.4 deduped
| | | | +-- @azure/core-http@1.2.6 deduped
| | | | +-- @azure/core-lro@1.0.5 deduped
| | | | +-- @azure/core-paging@1.2.0 deduped
| | | | +-- @azure/core-tracing@1.0.0-preview.9 deduped
| | | | +-- @azure/logger@1.0.3 deduped
| | | | +-- @opentelemetry/api@0.10.2 deduped
| | | | +-- events@3.3.0 deduped
| | | | `-- tslib@2.3.1 deduped
| | | +-- @pnpm/link-bins@5.3.25
| | | | +-- @pnpm/error@1.4.0
| | | | +-- @pnpm/package-bins@4.1.0
| | | | | +-- @pnpm/types@6.4.0 deduped
| | | | | +-- fast-glob@3.2.7 deduped
| | | | | `-- is-subdir@1.2.0 deduped
| | | | +-- @pnpm/read-modules-dir@2.0.3
| | | | | `-- mz@2.7.0 deduped
| | | | +-- @pnpm/read-package-json@4.0.0
| | | | | +-- @pnpm/error@1.4.0 deduped
| | | | | +-- @pnpm/types@6.4.0 deduped
| | | | | +-- load-json-file@6.2.0
| | | | | | +-- graceful-fs@4.2.8 deduped
| | | | | | +-- parse-json@5.2.0 deduped
| | | | | | +-- strip-bom@4.0.0 deduped
| | | | | | `-- type-fest@0.6.0
| | | | | `-- normalize-package-data@3.0.3
| | | | |   +-- hosted-git-info@4.0.2
| | | | |   | `-- lru-cache@6.0.0 deduped
| | | | |   +-- is-core-module@2.8.0
| | | | |   | `-- has@1.0.3 deduped
| | | | |   +-- semver@7.3.5 deduped
| | | | |   `-- validate-npm-package-license@3.0.4 deduped
| | | | +-- @pnpm/read-project-manifest@1.1.7
| | | | | +-- @pnpm/error@1.4.0 deduped
| | | | | +-- @pnpm/types@6.4.0 deduped
| | | | | +-- @pnpm/write-project-manifest@1.1.7
1

From SPFx 1.13 release notes

To configure the browser launch correctly, update the initialPage property within the ./config/serve.json to point to your SharePoint Online tenant. For example: https://contoso.sharepoint.com/_layouts/15/workbench.aspx.

Not performing this configuration task will result in an error the first time gulp serve runs.

1
  • ok thanks for the helpful reply
    – john Gu
    Nov 14 '21 at 17:40

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.