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

yarn start: 'tsc' is not recognized as an internal or external command #523

Open
jasonrundell opened this issue Sep 25, 2020 · 21 comments
Open
Labels
bug Something isn't working hacktoberfest Great for contribution during hacktoberfest.

Comments

@jasonrundell
Copy link
Contributor

Describe the bug

Project does not start due to tsc not being present.

To Reproduce

  1. Fork repo
  2. Run yarn
  3. Run yarn start

Expected behavior

Success output.

Screenshots

image

Desktop (please complete the following information):

  • OS: Windows 10 Home
  • Browser N/A
  • Version No version present in intuit/design-systems-cli
@jasonrundell jasonrundell added the bug Something isn't working label Sep 25, 2020
@jasonrundell
Copy link
Contributor Author

If you want to add this to hacktoberfest I can try and submit a PR for the fix.

@hipstersmoothie hipstersmoothie added the hacktoberfest Great for contribution during hacktoberfest. label Sep 25, 2020
@hipstersmoothie
Copy link
Contributor

Go for it

@jasonrundell
Copy link
Contributor Author

@hipstersmoothie which approach do you prefer?

  1. Assume TypeScript is installed on user's machine: add something to the README explaining this assumption and instructions on how to install TS.

  2. Add typescript to the package.json?

@adierkens
Copy link
Collaborator

Add typescript to the package.json?

It's already declared as a dependency: https://github.com/intuit/design-systems-cli/blob/master/package.json#L46

@jasonrundell
Copy link
Contributor Author

Add typescript to the package.json?

It's already declared as a dependency: https://github.com/intuit/design-systems-cli/blob/master/package.json#L46

Why is tsc not included?

@adierkens
Copy link
Collaborator

Maybe a windows thing? Potentially a npm/node versioning issue?
I just tried a clean clone of the repo and did yarn and yarn start without issue -- but i'm on a macbook. If you're able to diagnose the problem, i'd be curious to know what the underlying issue is.

@pixeleate
Copy link

I would like to work on this issue, I can test the solution in both platforms

@pixeleate
Copy link

I have tested this on Windows 10 Home / Pro, Mac and Linux (Ubuntu), everything is running fine for me, no errors following the indicated steps.

@jasonrundell
Copy link
Contributor Author

I have tested this on Windows 10 Home / Pro, Mac and Linux (Ubuntu), everything is running fine for me, no errors following the indicated steps.

Ok interesting. I'm using a fresh Windows after adding all new hardware. I'm going to start digging into this issue this week.

@jasonrundell
Copy link
Contributor Author

I have tested this on Windows 10 Home / Pro, Mac and Linux (Ubuntu), everything is running fine for me, no errors following the indicated steps.

What happens if you type tsc in your Windows terminal? Also, which Windows terminal are you using? PowerShell? bash?

@jasonrundell
Copy link
Contributor Author

Just an update that I also can reproduce the same error on my work Mac
image
image

@jasonrundell
Copy link
Contributor Author

@hipstersmoothie can confirm that installing TypeScript locally is what corrects this error.

Can I PR in a README change to help new users make sure they have the pre-requisite software installed as global libraries on their machine before they use the design systems cli?

@pixeleate
Copy link

I don't have typescript installed locally, I'm not seeing the error, and it shouldn't be a pre-requisite, one possible solution could be rather that using the tsc alone, you can use the path to local executable ./node_modules/.bin/tsc.

I'm using zsh as my shell interpreter in Mac, Linux and Windows

@adierkens
Copy link
Collaborator

you can use the path to local executable ./node_modules/.bin/tsc.

Any hard-coded path implies an OS (windows has the opposite path separators). I would expect a lot of this to be handled by yarn internally. Could it be a yarn issue? What version are you using? Does it behave the same if you use node start instead of yarn start?

@jasonrundell
Copy link
Contributor Author

I don't have typescript installed locally, I'm not seeing the error, and it shouldn't be a pre-requisite, one possible solution could be rather that using the tsc alone, you can use the path to local executable ./node_modules/.bin/tsc.

I'm using zsh as my shell interpreter in Mac, Linux and Windows

I get no node_modules after running yarn or yarn install

@adierkens
Copy link
Collaborator

I get no node_modules after running yarn or yarn install

That seems like the underlying problem. Are you on yarn-v1 or yarn-v2?

@jasonrundell
Copy link
Contributor Author

I get no node_modules after running yarn or yarn install

That seems like the underlying problem. Are you on yarn-v1 or yarn-v2?

version 1.22.5

@pixeleate
Copy link

I don't have typescript installed locally, I'm not seeing the error, and it shouldn't be a pre-requisite, one possible solution could be rather that using the tsc alone, you can use the path to local executable ./node_modules/.bin/tsc.
I'm using zsh as my shell interpreter in Mac, Linux and Windows

I get no node_modules after running yarn or yarn install

That's exactly the reason because tsc is not working for you.

I'm using yarn@1.22.5, npm@6.14.6 and node@12.18.4, everything working without any issue

@pixeleate
Copy link

pixeleate commented Sep 29, 2020

@jasonrundell I can see the following line in your terminal output:
image
that mean that you're getting an error installing the modules, you should upgrade your node version to at least 10.18.1, and that could be the minimum required version, this could be added to the readme.

I feel that if you upgrade you will not have any problem again.

@jasonrundell
Copy link
Contributor Author

Upgraded to node version v12.18.4 and yarn install finished node_modules download.

yarn start looks to be working correctly...

[4:48:11 PM] Starting compilation in watch mode...

[4:49:22 PM] Found 0 errors. Watching for file changes.

Ok, so should the README declare the minimum version of node to be 10.18.1?

@pixeleate
Copy link

pixeleate commented Sep 29, 2020

You could just add the engines section to the package.json that will show an error to the users if they are using a different version and will suggest which one should be used

"engines": {
    "node": ">=10.18.1"
}

Along with that a badge with the expected node version can be added to the README.

node-current badge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest Great for contribution during hacktoberfest.
Projects
None yet
Development

No branches or pull requests

4 participants