kreteshq / kretes

A Programming Environment for TypeScript & Deno
https://kretes.dev/
Other
675 stars 35 forks source link

'kretes new' command fails on fresh install #113

Closed brandon-fryslie closed 3 years ago

brandon-fryslie commented 3 years ago

I'm running MacOS Mojave 10.14.6. NodeJS v14.15.1.

Creating a new project with a fresh install of Kretes causes this error:

% kretes new viz_kretes
YError: Invalid second argument. Expected object but received function.
    at argumentTypeError (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:163:11)
    at /usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:145:17
    at Array.forEach (<anonymous>)
    at argsert (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:138:25)
    at Object.option (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:2288:9)
    at /usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:421:28
    at Array.forEach (<anonymous>)
    at Object.runCommand (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:420:49)
    at Object.parseArgs [as _parseArgs] (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:2697:57)
    at Object.get [as argv] (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:2651:25)
YError: Invalid second argument. Expected object but received function.
    at argumentTypeError (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:163:11)
    at /usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:145:17
    at Array.forEach (<anonymous>)
    at argsert (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:138:25)
    at Object.option (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:2288:9)
    at /usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:421:28
    at Array.forEach (<anonymous>)
    at Object.runCommand (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:420:49)
    at Object.parseArgs [as _parseArgs] (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:2697:57)
    at Object.get [as argv] (/usr/local/lib/node_modules/kretes/node_modules/yargs/build/index.cjs:2651:25)

Steps to reproduce: Run kretes new project_name with fresh kretes install via npm install -g kretes.

Expected behavior: Project scaffolding would be created

Actual behavior: The program crashed and did not create the scaffolding

FDiskas commented 3 years ago

Also getting some issues starting a new project

kretes new preact
/home/***/.nvm/versions/node/v12.19.0/lib/node_modules/kretes/node_modules/retes/dist/index.js:252
            this.server?.listen(port, () => {
                        ^

SyntaxError: Unexpected token '.'

Reference: https://github.com/kreteshq/retes/issues/6

FDiskas commented 3 years ago

In my case the issue is node v12

FDiskas commented 3 years ago

Its funny - actually your CI was failing also https://github.com/kreteshq/kretes/pull/112/checks#step:6:50 This is a good question why nobody was warned about it

zaiste commented 3 years ago

@brandon-fryslie @FDiskas this should be fixed now. Feel free to let me know otherwise.

For the CI there was a breaking update in PNPM that I missed. It's OK now.