Error running react project generator
jwalsh-zipari opened this issue · comments
when running command and selecting "react" as the project type, I get the following error. It happens repeatedly. OS is Mac OS Catalina.
npx: installed 133 in 3.672s
superplate-cli has encountered an error.
If you think this is caused by a bug. Please check out:
https://github.com/pankod/superplate/issues
ERROR /private/var/folders/7h/mv8y8mdx7pg53qb59dqkhgn00000gp/T/d-20211113-60344-1tf92au.ww0m/react/prompt.js:201
return !answers.features?.includes("storybook");
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at SAO.prompts (/Users/jwalsh/.npm/_npx/60344/lib/node_modules/superplate-cli/lib/saofile.js:28:27)
at runPrompts (/Users/jwalsh/.npm/_npx/60344/lib/node_modules/superplate-cli/node_modules/sao/dist/run-prompts.js:19:79)
at SAO.runGenerator (/Users/jwalsh/.npm/_npx/60344/lib/node_modules/superplate-cli/node_modules/sao/dist/chunk.T-GsVNZ1.js:7126:13)
In my case, change/upgrade node version from 12.20..0
to 14.x
. If you using nvm, just nvm install 14.XX
, and done!.
I think, in package.json (root project) must add this
"engines": {
"node": "14.x",
"yarn": "1.x"
},
ok, I updated to latest LTS version of Node 14 and re-ran the command and it worked, thank you!