ampstart icon indicating copy to clipboard operation
ampstart copied to clipboard

ReferenceError: primordials is not defined

Open amejiarosario opened this issue 5 years ago • 1 comments

Using node 12 and gulp 3. That combination does not work: https://github.com/gulpjs/gulp/issues/2324

$ npm run build

> kickstart@ build /Users/admejiar/Code/tmp/ampstart
> gulp build

fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26

I tried gulp 4 and getting different errors

amejiarosario avatar Jun 09 '19 14:06 amejiarosario

Regarding the Node version: the engines section of the package.json specifies that Node version ^7.0.0 is required. The caret (^) allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. Therefore, the highest version one should use is v7.10.1. You'll need to use NVM or NVM for Windows to switch versions and build as intended.

Regarding the Gulp version: the devDependencies section of the package.json specifies that Gulp version ^3.9.1 is required. One should use the locally-installed version of Gulp rather than the global installation. Having a different version of Gulp installed globally may interfere with using the locally installed one. The global installation should probably be uninstalled.

From what I saw from other bug reports, "ReferenceError: primordials is not defined" seems to primarily affect Windows users. Even with the correct versions of the above, additional bugs are present on Windows 10. @amejiarosario, if you are on Windows 10, you will need to wait for #878 to be merged before npm i and npm run build will complete smoothly. Feel free to clone and use my fork in the mean time.

ghost avatar Jun 24 '19 18:06 ghost