A
A
anriko2020-12-13 10:59:22
npm
anriko, 2020-12-13 10:59:22

How to fix primordials is not defined error?

node version v14.15.1
gulp
CLI version 2.1.0
Local version 3.9.1

run gulp error

gulp development

fs.js:45
} = primordials;
^

ReferenceError: primordials is not defined
at fs.js:45:5
at req_ (C:\Users\Anriko\Desktop\rarus-test-master\rarus-test-master\node_modules\natives\index.js:143:24)
at Object.req [as require] (C:\Users\Anriko\Desktop\rarus-test-master\rarus-test-master\node_modules\natives\index.js:55:10)
at Object. (C:\Users\Anriko\Desktop\rarus-test-master\rarus-test-master\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)


on version 12 of node

const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (C:\Users\Anriko\Desktop\rarus-test-master\rarus-test-master\node_modules\natives\index.js:143:24)
    at Object.req [as require] (C:\Users\Anriko\Desktop\rarus-test-master\rarus-test-master\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (C:\Users\Anriko\Desktop\rarus-test-master\rarus-test-master\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirolga, 2020-12-26
@kirolga

Faced with such a bug. This bug occurs on node >=12 and gulp < 4.
Possible solutions to the problem:
- switch to a new version of gulp
- roll back the node version (so that it is less than 12)
The first point is, of course, preferable.
If none of the options work, you can use the solutions https://stackoverflow.com/questions/55921442/how-t...

F
freeeeez, 2022-04-12
@freeeeez

Faced the same problem.
Installed nvm.
Installed additional version of node 6.17.1.
nvm use 6.17.1 select version
nvm alias default 6.17.1 remember default version
gulp now works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question