Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 24, 2020

Conversation

lpolito
Copy link
Contributor

@lpolito lpolito commented Jan 16, 2020

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
Copy link
Contributor Author

lpolito commented Jan 16, 2020

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
Copy link
Collaborator

swyxio commented Jan 16, 2020

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

@lpolito
Copy link
Contributor Author

lpolito commented Jan 24, 2020

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
Copy link
Collaborator

swyxio commented Jan 24, 2020

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
Copy link
Collaborator

swyxio commented Jan 24, 2020

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

@allcontributors
Copy link
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