yeoman / generator-chrome-extension

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

ReferenceError: primordials is not defined #232

Closed charalamm closed 2 years ago

charalamm commented 2 years ago

I am new to javascript. I am trying to create a chrome extension by following the steps of README.md.

Everything works fine until the gulp commands. When attempting to run any of the:

gulp babel

gulp watch

gulp build

I get the error:

[08:56:55] Requiring external module @babel/register
ReferenceError: primordials is not defined
    at fs.js:40:5
    at req_ (/home/charalamm/Documents/myProjects/chrome_extension/extension/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/charalamm/Documents/myProjects/chrome_extension/extension/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/charalamm/Documents/myProjects/chrome_extension/extension/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Module._compile (/home/charalamm/Documents/myProjects/chrome_extension/extension/node_modules/pirates/lib/index.js:136:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Object.newLoader [as .js] (/home/charalmm/Documents/myProjects/chrome_extension/extension/node_modules/pirates/lib/index.js:141:7)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
motonuko commented 2 years ago

Follow the comments in https://github.com/yeoman/generator-chrome-extension/issues/222. I downgraded node version to v10.18.0 and it works now