Skip to content

(fix) Enforce Node version for tsdx create, update documentation to express requirement.#433

Merged
swyxio merged 2 commits into
jaredpalmer:masterfrom
lpolito:master
Jan 24, 2020
Merged

(fix) Enforce Node version for tsdx create, update documentation to express requirement.#433
swyxio merged 2 commits into
jaredpalmer:masterfrom
lpolito:master

Conversation

@lpolito

@lpolito lpolito commented Jan 16, 2020

Copy link
Copy Markdown
Contributor

Fixes #432

There was a few ways I could have approached this, so let me know if there's something more ideal.

To test:

  1. Build.
  2. Change Node version to < 10 - nvm use 8.11.3
  3. Run node /dist/index.js create foo, select any template – observe error
Unsupported Node version! Your current Node version (v8.11.3) does not satisfy the requirement of Node >=10.
  1. Change Node version to >=10 - nvm use 10.17.0
  2. Run node /dist/index.js create bar, select any template – observe success.

@lpolito lpolito changed the title Enforce Node version for tsdx create, update documentation to express requirement. (fix) Enforce Node version for tsdx create, update documentation to express requirement. Jan 16, 2020
@lpolito lpolito marked this pull request as ready for review January 16, 2020 19:55
@lpolito

lpolito commented Jan 16, 2020

Copy link
Copy Markdown
Contributor Author

Turns out there's a way to specify a version of node when running npx

So the command would be npx -p node@10 npx tsdx create {name}.
It's a little weird but it seems to work.

Maybe that should just go in the docs? The addition of engine in the template would still be valid, though.

@swyxio

swyxio commented Jan 16, 2020

Copy link
Copy Markdown
Collaborator

TIL about npx -p node@10... but how does that even work if you dont have that version installed!?

@lpolito

lpolito commented Jan 24, 2020

Copy link
Copy Markdown
Contributor Author

TIL about npx -p node@10... but how does that even work if you dont have that version installed!?

Wasn't sure if this PR was waiting on the answer to this 😶

It works the same way as npx normally does (magic), except the package you're specifying is the particular node version. Then you just give it the command you want to run while running that node version. 🤷‍♂

@swyxio

swyxio commented Jan 24, 2020

Copy link
Copy Markdown
Collaborator

haha no i was just leaving room for the other maintainers to comment if needed. i'll go ahead n merge

@swyxio swyxio merged commit 9f183e7 into jaredpalmer:master Jan 24, 2020
@swyxio

swyxio commented Jan 24, 2020

Copy link
Copy Markdown
Collaborator

thanks for the great PR! @all-contributors please add @lpolito for code and docs

@allcontributors

Copy link
Copy Markdown
Contributor

@sw-yx

I've put up a pull request to add @lpolito! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: Node 10+ requires Node 10+

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document Node version support / add a warning to tsdx create

3 participants