jekyllt / jasper2

Full-featured Jekyll port of Ghost's default theme Casper v2 👻
https://jekyllt.github.io/jasper2/
MIT License
763 stars 659 forks source link

Fix 'ReferenceError: primordials is not defined' Error #116

Closed dumrauf closed 3 years ago

dumrauf commented 3 years ago

While executing the instructions on https://github.com/jekyller/jasper2#compiling-styles for compiling the styles, I ran into the following error

$ gulp
ReferenceError: primordials is not defined
    at fs.js:45:5
    at req_ (/Users/dominic/Software Engineering/github/jasper2/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/Users/dominic/Software Engineering/github/jasper2/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/Users/dominic/Software Engineering/github/jasper2/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)

Copying the error message into a search engine of my choice (it's Google if you want to know), quickly lead me to this answer on StackOverflow.

I'm no Node.js expert but it seems that I happen to have an unlucky (but fairly modern) combination of gulp and node. This seems to be a common problem as outlined multiple times on the same StackOverflow page.

The solution proposed in the above answer eventually worked for me.

Given more people might run into this problem in the future, it might be worth providing this "fix" until a proper solution becomes available.