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

Using yarn producess 'tsc-alias' is not recognized as an internal or external command, operable program or batch file. #136

Closed
RodrigoTomeES opened this issue Jun 13, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@RodrigoTomeES
Copy link

RodrigoTomeES commented Jun 13, 2024

Hi,

I have this script "yarn lint && yarn tsc && yarn Build 'src/**/*.ts'" to build my package astro-rename and when I use yarn instead of npm doesn't find tsc-alias packages.

$ yarn run build

  Target\src\index.js    2.9kb
  Target\src\utils.js    951b
  Target\src\options.js  159b
  Target\src\types.js      0b

Done in 9ms

  Target/src/index.js ─── 2.9kb ─ 100.0%
   └ src/index.ts ─────── 2.9kb ── 99.3%

  Target/src/utils.js ─── 951b ── 100.0%
   └ src/utils.ts ─────── 801b ─── 84.2%

  Target/src/options.js ─ 159b ── 100.0%
   └ src/options.ts ───── 130b ─── 81.8%

  Target/src/types.js ───── 0b ── 100.0%

'tsc-alias' is not recognized as an internal or external command,
operable program or batch file.

Is it possible to solve it? Thanks!

@NikolaRHristov
Copy link
Member

NikolaRHristov commented Jun 13, 2024

Heck, well tsc-alias gets executed via a "shell" prompt in a child_process in https://github.com/PlayForm/Build/blob/Current/Source/Function/Build.ts#L55 from

const { stdout, stderr } = (await import("child_process")).exec(
Command,
);
Can you maybe also try to add it as a dependency in your project as well ?

yarn install tsc-alias
# or however you install things with yarn 😁

@RodrigoTomeES
Copy link
Author

Yeah, I already tried it but it also throw the error

@NikolaRHristov
Copy link
Member

Damn, Ok. I will test it out with yarn and give you feedback.

@NikolaRHristov NikolaRHristov added the enhancement New feature or request label Jun 16, 2024
@NikolaRHristov
Copy link
Member

So, I'm trying it out on https://github.com/Nikolarhristov/DeveloperYarn with

package.json in https://github.com/PlayForm/Compress/blob/1bf7e08f7eab607a7931a6eba37199299ec10af8/package.json#L39

and it runs successfully.

Also it runs when I do it from the parent turborepo task in package.json https://github.com/NikolaRHristov/DeveloperYarn/blob/Current/package.json

I see that you're now using npx in https://github.com/RodrigoTomeES/astro-rename/blob/feature/v2/package.json

Are you still having this issue with yarn or just chose to switch to npm?

@NikolaRHristov NikolaRHristov closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
@RodrigoTomeES
Copy link
Author

@NikolaRHristov I think you didn't have the issue because you used the v1 version instead of v4 (that I am using).

I changed to npm to avoid the error

@NikolaRHristov
Copy link
Member

NikolaRHristov commented Jun 23, 2024

I was able to run it with yarn v4.3.1 as well but glad you got it resolved by using npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants