dzuluaga / generator-apigee-deploy-grunt-api

Yeoman generator for apigee-deploy-grunt-api
MIT License
10 stars 5 forks source link

Generator is not working with node v12 #5

Open micovery opened 4 years ago

micovery commented 4 years ago

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 commented 4 years ago

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 graceful-fs@4.2.3' \;

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 commented 4 years ago

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