Skip to content
New issue

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

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

Already on GitHub? # to your account

Using npx tsconfig.json only opens a file (does not work - Windows) #43

Open
max-programming opened this issue Sep 8, 2021 · 13 comments

Comments

@max-programming
Copy link

Whenever I run npx tsconfig.json, it opens a tsconfig.json file in C:\Users\<username>\AppData\Local\npm-cache\_npx\bb22b66c4c94b5c9\node_modules\.bin\tsconfig.json on Windows. How can I make it work?

image

@max-programming max-programming changed the title Using npx tsconfig.json only opens a file Using npx tsconfig.json only opens a file (does not work - Windows) Sep 8, 2021
@DannyZolp
Copy link

#18
the problem resides with windows trying to open the .json file instead of running it in the terminal
(probably) can't be fixed unless ben changed the project name to something else

@max-programming
Copy link
Author

#18
the problem resides with windows trying to open the .json file instead of running it in the terminal
(probably) can't be fixed unless ben changed the project name to something else

Oh I see. So Powershell is trying to open the file instead of running the script :|

@davecarrijo
Copy link

So, did you find a way to solve? @max-programming

@DontEatRice
Copy link

if you have installed git bash for example just type ./node_modules/.bin/tsconfig.json and it will work @Waiolo

@davecarrijo
Copy link

it just give another error @DontEatRice
https://i.imgur.com/ABApnY2.png

@davecarrijo
Copy link

I found out. just type npx tsconfig.json.cmd . Just add a cmd at the end.

@Ross-Ghazi
Copy link

npx tsconfig.json.cmd

Worked for me.

@OmgImAlexis
Copy link

Duplicate of #47

@tanishqdaiya
Copy link

tanishqdaiya commented Mar 8, 2022

None of that worked with me. That's an issue and the ONLY fix I found to be working was to clone the project and build it yourself with a custom name

@OmgImAlexis
Copy link

@tanishqdaiya did you check the link I provided? If it's not working please show the error, etc. that's happening when you try it.

There should be no reason this doesn't work. #47 (comment)

@tanishqdaiya
Copy link

@OmgImAlexis Thanks for the solution. Using Windows has always been harder for me since I switched from Linux (don't ask me why). Can we set an alias in powershell for that command (C:\"Program Files"\nodejs\tsconfig.json.cmd)?

@OmgImAlexis
Copy link

Yep, add this to your profile. You can find your profile by using this command in powershell $profile.

function call_tsconfig($args) { C:\"Program Files"\nodejs\tsconfig.json.cmd $args}
Set-Alias tsconfig call_tsconfig

Then call it with tsconfig in your powershell.

@DamianArado
Copy link

I found out. just type npx tsconfig.json.cmd . Just add a cmd at the end.

Thanks, this works! I'm using command prompt on Windows.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants