yeoman / generator-chrome-extension

Scaffold out a Chrome extension
http://yeoman.io
MIT License
2.61k stars 226 forks source link

ReferenceError: primordials is not defined #222

Closed itsazzad closed 2 years ago

itsazzad commented 4 years ago

gulp watch

Requiring external module @babel/register fs.js:35 } = primordials; ^

ReferenceError: primordials is not defined at fs.js:35:5 at req_ (.../node_modules/natives/index.js:143:24) at Object.req [as require] (.../node_modules/natives/index.js:55:10) at Object. (.../node_modules/graceful-fs/fs.js:1:37) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Module._compile (.../node_modules/pirates/lib/index.js:99:24) at Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Object.newLoader [as .js] (.../node_modules/pirates/lib/index.js:104:7) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14)

wungjaelee commented 4 years ago

I think this has to do with some compatibility issue with the node version. I was using node 13.15.0 and was getting this issue, but the issue was gone after I changed the node version to 10.16.0

waglik commented 4 years ago

Update Gulp locally to 4.0.0 and it starts to work. Though I run into other issues so not sure if this was related or not.

snowman commented 3 years ago

It works!!!

➜ nvm ls
         v8.9.0
       v10.18.0
       v10.18.1
->     v12.14.0
         system

➜ gulp babel
[11:24:24] Requiring external module @babel/register
ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (/tmp/my-new-chrome-extension/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/tmp/my-new-chrome-extension/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/tmp/my-new-chrome-extension/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Module._compile (/tmp/my-new-chrome-extension/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Object.newLoader [as .js] (/tmp/my-new-chrome-extension/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
➜ nvm use v10.18.0
Now using node v10.18.0 (npm v6.13.4)

➜ gulp babel
[11:25:47] Requiring external module @babel/register
[11:25:48] Using gulpfile /tmp/my-new-chrome-extension/gulpfile.babel.js
[11:25:48] Starting 'babel'...
[11:25:48] Finished 'babel' after 85 ms