urbit / create-landscape-app

Get started making a simple app for Landscape with a few commands.
86 stars 21 forks source link

Setup command not running on Ubuntu 22.04 #77

Closed ajlamarc closed 2 years ago

ajlamarc commented 2 years ago

I tried the following command with and without the --typescript flag: $ npx @urbit/create-landscape-app

output:

const ts = Boolean(process.argv?.[2] === "--typescript");
                                ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
matildepark commented 2 years ago

Any idea what your nodejs version is?

ajlamarc commented 2 years ago

node version v12.22.9, npm version 8.5.1

I ended up building manually from the ts folder but don't want the next person to hit this same issue

matildepark commented 2 years ago

This issue is because option chaining isn’t supported in node.js 13 and below. Node.js 12 reached end of life in 2020, so I’m hesitant to polyfill to fix it…but if the actual template works in node.js 12, then I suppose it makes sense.

matildepark commented 2 years ago

Even old Groups (about to be deprecated) is pegged at node 14. https://github.com/urbit/urbit/blob/master/pkg/interface/.nvmrc

matildepark commented 2 years ago

It's unfortunate Ubuntu 22.04 is pegged at such an old version; I think for the purpose of this developer experience tool we may have no choice but to support it since Ubuntu LTS is essentially the default environment for many starting developers. Let me fix.

ajlamarc commented 2 years ago

I don't think the latest changes solved the problem :)

I'd document updating node?

npm cache clean -f
sudo npm install -g n
sudo n stable
matildepark commented 2 years ago

Did you clear your npx cache?

ajlamarc commented 2 years ago

Did you clear your npx cache?

No, that would probably do it. Thanks!