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

[turborepo] Starter produces an error #3797

Closed
thany opened this issue Feb 14, 2023 · 5 comments · Fixed by #3813
Closed

[turborepo] Starter produces an error #3797

thany opened this issue Feb 14, 2023 · 5 comments · Fixed by #3813
Labels
area: examples Improvements or additions to examples area: windows Issues specifically reproducing on Windows pkg: create-turbo Issues related to npx create-turbo

Comments

@thany
Copy link

thany commented Feb 14, 2023

What version of Turborepo are you using?

1.7.4

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Windows

Describe the Bug

Running npm run lint after installing the starter, produces an error:

ui:lint: > ui@0.0.0 lint
ui:lint: > TIMING=1 eslint "**/*.ts*"
ui:lint:
web:lint:
web:lint: > web@0.0.0 lint
web:lint: > next lint
web:lint:
ui:lint: 'TIMING' is not recognized as an internal or external command,
ui:lint: operable program or batch file.
ui:lint: npm ERR! Lifecycle script `lint` failed with error:
ui:lint: npm ERR! Error: command failed
ui:lint: npm ERR!   in workspace: ui@0.0.0
ui:lint: npm ERR!   at location: C:\Projects\my-turborepo\packages\ui
ui:lint: ERROR: command finished with error: command (C:\Projects\my-turborepo\packages\ui) npm run lint exited (1)
web:lint: ✔ No ESLint warnings or errors
docs:lint: ✔ No ESLint warnings or errors
command (C:\Projects\my-turborepo\packages\ui) npm run lint exited (1)

 Tasks:    0 successful, 1 total
Cached:    0 cached, 1 total
  Time:    2.606s

 ERROR  run failed: command  exited (1)

Expected Behavior

No error. Don't use commands that don't exist, or install something to make it work.

To Reproduce

  1. Install the starter: https://turbo.build/repo/docs/getting-started/create-new
  2. Run npm run lint
  3. Observe the error

Reproduction Repo

No response

@thany thany added area: turborepo kind: bug Something isn't working labels Feb 14, 2023
@thany
Copy link
Author

thany commented Feb 14, 2023

Worthy of note: I'm pretty sure how to fix this, but that's beside the point. The point is that the starter should work 'out of the box', no errors. So it should still be fixed in the starter package as well.

@chris-olszewski chris-olszewski added area: examples Improvements or additions to examples and removed kind: bug Something isn't working labels Feb 14, 2023
@mehulkar mehulkar added area: windows Issues specifically reproducing on Windows pkg: create-turbo Issues related to npx create-turbo area: examples Improvements or additions to examples and removed area: examples Improvements or additions to examples labels Feb 14, 2023
@mehulkar
Copy link
Contributor

We're setting TIMING=1 quite liberally in examples and in the create-turbo template. Will look into why that is before removing

@kodiakhq kodiakhq bot closed this as completed in #3813 Feb 15, 2023
kodiakhq bot pushed a commit that referenced this issue Feb 15, 2023
…ter (#3813)

This is not a cross-platform compatible way to set an environment variable, and it is not critical to have this as part of the examples and starter template.

Fixes #3797
@thany
Copy link
Author

thany commented Feb 15, 2023

Or include cross-env to make it work everywhere 😊

@mehulkar
Copy link
Contributor

@thany we talked about cross-env yesterday, but after looking into it and seeing that it spawns another process to set the env vars, we felt it wasn't worth the performance hit. @tknickman also pointed out that we include the pro tip of setting this env var in our docs.

@thany
Copy link
Author

thany commented Feb 16, 2023

All good and well, and I've briefly read through it to make sure I have some sort of understanding of how turbo handles environment variables.

It seems that we are confusing including already-set variables and setting variables with a value in the first place. Turbo.json appears to only do the former, whereas cross-env is responsible for the latter. So unless you can point me (and everyone else 😉) to a way to set an environment variable with a value in turbo.json, or any other built-in thing without using cross-env, I'd be all ears.

Other than that, I have no idea how to set any environment variable in a cross-platform manner, without the use of some sort of package like cross-env. The Linux syntax certainly won't work on Windows, that's for sure, and the Windows syntax doesn't work on Linux. Kind of the point why cross-env exists in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples area: windows Issues specifically reproducing on Windows pkg: create-turbo Issues related to npx create-turbo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants