web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Getting an error runni...
Power Pages
Suggested Answer

Getting an error running pac

(0) ShareShare
ReportReport
Posted on by
 pac
fs.js:42
} = primordials;
    ^
ReferenceError: primordials is not defined
    at fs.js:42:5
    at req_ (/Users/atreyarunsinainadkarni/.nvm/versions/node/v16.20.2/lib/node_modules/pac/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/Users/atreyarunsinainadkarni/.nvm/versions/node/v16.20.2/lib/node_modules/pac/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/Users/atreyarunsinainadkarni/.nvm/versions/node/v16.20.2/lib/node_modules/pac/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
 
tried older node versions, runninng on mac
Categories:
I have the same question (0)
  • Suggested answer
    Inogic Profile Picture
    1,265 Moderator on at
    Hi,
     
    It seems like you're encountering an issue with the primordials error, which is common when trying to run older packages (such as pac) on a newer version of Node.js. This happens because the primordials reference was removed in newer versions of Node.js, and certain libraries (like older versions of graceful-fs or pac) still depend on it.

    Here’s how you can resolve this:

    Solution 1: Upgrade the pac package

    If possible, try upgrading the pac package to the latest version. Newer versions of pac may have fixed this issue to work with modern Node.js versions.
    1. Check for updates:
      Run the following command to check if there's an update for pac:
      npm outdated pac
    2. Update the package:
      If an update is available, you can upgrade it by running:
      npm install -g pac

    OR
    Solution 2: Downgrade Node.js to a compatible version
    If you're unable to update pac, you can use a Node.js version that is compatible with your current pac version. The error is typically associated with Node.js v12 and later, so downgrading to Node.js v10 should resolve the issue.
    You can use nvm to switch to Node.js v10:
    1. Install Node.js v10 using nvm:
    nvm install 10
    nvm use 10
    1. Re-run pac and check if the error still occurs.

    OR
    Solution 3: Apply a patch for graceful-fs
    If you can't update pac or downgrade Node.js, you could manually patch the issue by upgrading the graceful-fs dependency inside the pac package:
    1. Navigate to the pac package directory:
    cd /Users/atreyarunsinainadkarni/.nvm/versions/node/v16.20.2/lib/node_modules/pac
    1. Install a newer version of graceful-fs:
    npm install graceful-fs@latest
    1. Try running pac again.
    OR
    Solution 4: Use the natives package workaround
    In some cases, the issue might be resolved by installing the natives package that is compatible with your Node.js version.
    1. Install natives package:
    npm install natives
    1. Try running pac again.
    Hope this helps.
     

    Thanks!

    Inogic Professional Services: Power Platform/Dynamics 365 CRM
    An expert technical extension for your techno-functional business needs
    Service: https://www.inogic.com/services/ 
    Tips and Tricks: https://www.inogic.com/blog/ 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 51

#2
rezarizvii Profile Picture

rezarizvii 35

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 33 Most Valuable Professional

Last 30 days Overall leaderboard