sp-dev-fx-extensions icon indicating copy to clipboard operation
sp-dev-fx-extensions copied to clipboard

Getting error when following instructions primordials not defined.

Open vayinapurapu opened this issue 7 months ago • 0 comments

Sample

https://github.com/pnp/sp-dev-fx-extensions/tree/main/samples/js-command-copy-classic-link

Author(s)

Anoop Thatti

What happened?

when trying to run the gulp build i am getting the below error (base) vinaydeepayinapurapu@vinaydeeps-MacBook-Pro js-command-copy-classic-link % gulp build ReferenceError: primordials is not defined at fs.js:44:5 at req_ (/Users/vinaydeepayinapurapu/Desktop/VinayWorkingDocs/SPFx/js-command-copy-classic-link/node_modules/natives/index.js:143:24) at Object.req [as require] (/Users/vinaydeepayinapurapu/Desktop/VinayWorkingDocs/SPFx/js-command-copy-classic-link/node_modules/natives/index.js:55:10) at Object. (/Users/vinaydeepayinapurapu/Desktop/VinayWorkingDocs/SPFx/js-command-copy-classic-link/node_modules/gulp/node_modules/graceful-fs/fs.js:1:37) at Module._compile (node:internal/modules/cjs/loader:1730:14) at Object..js (node:internal/modules/cjs/loader:1895:10) at Module.load (node:internal/modules/cjs/loader:1465:32) at Function._load (node:internal/modules/cjs/loader:1282:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)

Steps to reproduce

  1. cloned the repo
  2. went to specific project in this case my path is /Users/vinaydeepayinapurapu/Desktop/VinayWorkingDocs/SPFx/js-command-copy-classic-link
  3. ran npm install
  4. ran gulp build. Unable to successfullly build the project.

Expected behavior

Able to serve in developer environment for instance serve.json url and able to get the classic link

Target SharePoint environment

SharePoint Online

Developer environment

None

Browsers

  • [ ] Internet Explorer
  • [ ] Microsoft Edge
  • [ ] Google Chrome
  • [ ] FireFox
  • [ ] Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Node.js version

v18.20.8

Additional environment details

(base) vinaydeepayinapurapu@vinaydeeps-MacBook-Pro js-command-copy-classic-link % npm ls -g --depth=0 /Users/vinaydeepayinapurapu/.nvm/versions/node/v22.17.1/lib ├── @microsoft/[email protected] ├── @pnp/[email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

vayinapurapu avatar Aug 13 '25 06:08 vayinapurapu