benawad/tsconfig.json

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

max-programming opened this issue · 13 comments

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

#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

#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 :|

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

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

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

npx tsconfig.json.cmd

Worked for me.

Duplicate of #47

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

@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)

@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)?

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.

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.