SPFX ReferenceError: primordials is not defined

Sajith Gopalakrishnan Hema 1,056 Reputation points
2021-07-14T19:09:02.357+00:00

I have updated machine with the latest version of Node.js LTS v14 with the below configurations. The latest recommended version is LTS v14.

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment

node -v = v14.17.3, npm -v = 7.19.1

gulp -v
CLI version: 2.3.0
Local version: 3.9.1

114724-global.png

Getting the error - ReferenceError: primordials is not defined

114656-primordials.png

There is one solution suggested to downgrade the version. Is there any way wthout downgrading Node version ?

https://learn.microsoft.com/en-us/answers/questions/149006/primordials-is-not-defined-in-spfx.html

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2021-07-15T06:59:57.337+00:00

    Hi @Sajith Gopalakrishnan Hema ,
    Gulp v3 isn't supported with Node.js v12+.
    This is not a change with SPFx. Its mentioned here to bring attention to it as this SPFx release adds support for Node.js v12.
    If you're using Node.js v12+ or higher, you must use Gulp v4+. If you're using a version of Node.js lower than v12, you must use Gulp v3. For more information, see: SharePoint Framework v1.12.1 release notes | Gulp versions & Node.js v12+.
    You can update gulp to v4.0.2 to solve the problem. Try following cmd please:

    npm install gulp@^4.0.2  
    

    For Reference:
    https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment


    If an Answer 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.