Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp 3 is broken on Node 12 #2324

Closed
murgatroid99 opened this issue Apr 24, 2019 · 6 comments
Closed

Gulp 3 is broken on Node 12 #2324

murgatroid99 opened this issue Apr 24, 2019 · 6 comments

Comments

@murgatroid99
Copy link

What were you expecting to happen?

Gulp does anything useful

What actually happened?

Gulp throws the following error:

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

ReferenceError: primordials is not defined
    at fs.js:27:35
    at req_ (/tmp/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/tmp/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/tmp/node_modules/gulp/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)

If using a TypeScript gulpfile with ts-node and typescript, the error looks like the following instead:

/tmp/node_modules/natives/index.js:143
    fn(internalBinding)(nm.exports, cachingRequire, nm, nm.filename, '<no dirname available>')
                       ^
ReferenceError: primordials is not defined
    at fs.js:27:35
    at req_ (/tmp/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/tmp/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/tmp/node_modules/gulp/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)

Please post a sample of your gulpfile (preferably reduced to just the bit that's not working)

This reproduces with an empty gulpfile

What version of gulp are you using?

3.9.1

What versions of npm and node are you using?

npm: 6.9.0
node: 12.0.0

@phated
Copy link
Member

phated commented Apr 24, 2019

Gulp 3 is no longer supported.

@phated phated closed this as completed Apr 24, 2019
@remillet
Copy link

remillet commented May 1, 2019

Having the exact same problem. Using:

node: v12.1.0
npm: 6.9.0
gulp CLI version: 2.2.0
gulp Local version: 4.0.1

[exec] fs.js:27 [exec] const { Math, Object, Reflect } = primordials; [exec] ^ [exec] [exec] ReferenceError: primordials is not defined [exec] at fs.js:27:35 [exec] at req_ (/Users/remillet/dev/src/nuxeo/addons/nuxeo-platform-spreadsheet/nuxeo-platform-spreadsheet-web/src/main/js/node_modules/natives/index.js:143:24) [exec] at Object.req [as require] (/Users/remillet/dev/src/nuxeo/addons/nuxeo-platform-spreadsheet/nuxeo-platform-spreadsheet-web/src/main/js/node_modules/natives/index.js:55:10) [exec] at Object.<anonymous> (/Users/remillet/dev/src/nuxeo/addons/nuxeo-platform-spreadsheet/nuxeo-platform-spreadsheet-web/src/main/js/node_modules/graceful-fs/fs.js:1:37) [exec] at Module._compile (internal/modules/cjs/loader.js:759:30) [exec] at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10) [exec] at Module.load (internal/modules/cjs/loader.js:628:32) [exec] at Function.Module._load (internal/modules/cjs/loader.js:555:12) [exec] at Module.require (internal/modules/cjs/loader.js:666:19) [exec] at require (internal/modules/cjs/helpers.js:16:16)

@angelomaragna
Copy link

@remillet one of the packages in your project is likely to be requiring gulp 3. If you inspect your package-lock.json which contains the list of installed packages, you should be able to sort it out.

@JRetza
Copy link

JRetza commented May 1, 2019

Same issue

node: 12.1.0
npm: 6.9.0
gulp: 4.0.1

fs.js:27
const { Math, Object, Reflect } = primordials;
                                  ^
ReferenceError: primordials is not defined
at fs.js:27:35

@stephenlacy
Copy link
Contributor

stephenlacy commented May 1, 2019

I will reiterate what @phated said. Gulp 3 is no longer supported.

@JRetza if you are able to reproduce that error on gulp version 4+ you can open a new issue.

@gulpjs gulpjs locked and limited conversation to collaborators May 1, 2019
@phated
Copy link
Member

phated commented May 2, 2019

And to clarify even further, the natives module would only come from a VERY outdated version of graceful-fs that is not included in gulp 4 so it's going to be a different issue within your project (like an incorrect lockfile).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants