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

Notifications

Announcements

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,135 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard