violentmonkey / generator-userscript

A yeoman generator to create a userscript project rapidly
95 stars 5 forks source link

TypeError: args.filter(...).flat is not a function #3

Closed 20after4 closed 3 years ago

20after4 commented 3 years ago

When I run this:

npx -p https://github.com/violentmonkey/generator-userscript.git -p yo yo @violentmonkey/userscript

I get the following error:

TypeError: args.filter(...).flat is not a function
    at exports.concatList.args (/home/monkey/.npm/_npx/32064/lib/node_modules/@violentmonkey/generator-userscript/lib/util/index.js:26:56)
    at BaseGenerator._updateDeps (/home/monkey/.npm/_npx/32064/lib/node_modules/@violentmonkey/generator-userscript/lib/generators/app/index.js:32:26)
    at BaseGenerator.prompting (/home/monkey/.npm/_npx/32064/lib/node_modules/@violentmonkey/generator-userscript/lib/generators/app/index.js:78:10)
    at process._tickCallback (internal/process/next_tick.js:68:7)

node.js version: v10.15.2

Any idea why "flat" is not a function?

gera2ld commented 3 years ago

Array#flat is supported by Node.js greater than v11.

Please update your Node.js. It's recommended to use v12 or above.

gera2ld commented 3 years ago

Just found that the prerequisite is out of date in README. I'll make an update.

20after4 commented 3 years ago

Just found that the prerequisite is out of date in README. I'll make an update.

Thank you!