I have installed node modules by npm install, then I tried to do gulp sass-watch in command prompt. After that I got the below response.
[18:18:32] Requiring external module babel-register
fs.js:27
const { Math, Object, Reflect } = primordials;
^
ReferenceError: primordials is not defined
Have tried this before gulp sass-watch
npm -g install gulp-cli
I hit the same error. I suspect you're using node 12 and gulp 3. That combination does not work: https://github.com/gulpjs/gulp/issues/2324
A previous workaround from Jan. does not work either: https://github.com/gulpjs/gulp/issues/2246
Solution: Either upgrade to gulp 4 or downgrade to an earlier node.
had same error and finally fix that when updated all packages and then mentioned the same node engine version and npm version in package.json
as it is in my local working system.
"engines": {
"node": "10.15.3",
"npm": "6.9.0"
}
i was getting this error when deploying on heroku.
for more checkout heroku support
Using NVM to manage what node version you're using, running the following commands worked for me:
$ cd /to/your/project/
$ nvm install lts/dubnium
$ nvm use lts/dubnium
$ yarn upgrade # or `npm install`
Downgrading to node stable fixed this issue for me, as it occurred after I upgraded to node 12
sudo n 10.16.0
I was getting this error on Windows 10. Turned out to be a corrupted roaming profile.
npm ERR! node v12.4.0
npm ERR! npm v3.3.12
npm ERR! primordials is not defined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
Deleting the C:\Users\{user}\AppData\Roaming\npm
folder fixed my issue.
Upgrade to 4.0.1 and make sure to migrate https://fettblog.eu/gulp-4-parallel-and-series/#migration
I faced the same issue. What i tried and worked for me:- 1). Check the version of NODE and GULP (combination of node v12 and gulp less than v4 doesn't work) 2). I downgrade npm version by : #sudo npm install -g n #sudo n 10.16.0 It worked fine, then just follow instruction of your consol
i have same problem, but i have solved this problem. i suggest you first, first make sure npm install your not problem. then you downgrade version node and gulp. i used version node 10.16.1 and gulp 3.9.1. for downgrade your gulp you can write
npm install gulp@^3.9.1
来源:https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node