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

Generator is not working with node v12 #5

Open
micovery opened this issue Apr 7, 2020 · 2 comments
Open

Generator is not working with node v12 #5

micovery opened this issue Apr 7, 2020 · 2 comments

Comments

@micovery
Copy link

micovery commented Apr 7, 2020

When running it, I get this error:

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (/opt/node-v12.4.0-darwin-x64/lib/node_modules/generator-apigee-deploy-grunt-api/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/opt/node-v12.4.0-darwin-x64/lib/node_modules/generator-apigee-deploy-grunt-api/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/opt/node-v12.4.0-darwin-x64/lib/node_modules/generator-apigee-deploy-grunt-api/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)

After a bit of Googling around this error, the consensus seems to be that graceful-fs is broken in node v12.

@micovery
Copy link
Author

micovery commented Apr 7, 2020

As a workaround, I ran this:

find $(npm config get prefix)/lib/node_modules/generator-apigee-deploy-grunt-api  \
-name "graceful-fs" \
-exec sh -c 'cd {}/../.. && npm install [email protected]' \;

To force all dependencies on graceful-fs to use version 4.2.3, and I did not get that error afterwards. Seems that a fix for this could be to make sure package-lock.json is published to NPM with a working version of graceful-fs.

@dzuluaga
Copy link
Owner

dzuluaga commented Apr 9, 2020

Sorry you ran into that. Thanks for posting a workaround.

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

No branches or pull requests

2 participants