ts-migrate icon indicating copy to clipboard operation
ts-migrate copied to clipboard

"bash is not recognized" Visual Studio Code

Open nicoproject opened this issue 5 years ago • 6 comments

Trying to run npx -p ts-migrate -c "ts-migrate-full " in git bash shell terminal in Visual Studio Code

$ npx -p ts-migrate -c "ts-migrate-full /d/_SERVER/domains/jquery-rangeslider-plugin" but it give "bash is not recognized" error in the end, what am i doing wrong?

image

nicoproject avatar Mar 09 '21 14:03 nicoproject

Same problem.But npx ts-migrate-full <folder> can work.

xll032 avatar Apr 23 '21 03:04 xll032

I don't have a Windows system to test on, so I'll have to ask for more information.

Could it be that you're in a Bash shell, but there is no bash on your PATH? It would be unusual, but I guess not impossible.

What does the command which bash print? Does the command /usr/bin/env bash work?

Also, would it be possible to get the exact error message in English? Sorry, I am more familiar with English error messages and they are easier to Google.

edsrzf avatar Apr 26 '21 09:04 edsrzf

When you check the files in ./node-modules/ts-migrate/bin it's only .sh files so not for windows users.

ibaraki-douji avatar Jul 02 '21 20:07 ibaraki-douji

My understanding of the original issue is that Bash is available on the system, but for some reason is not able to run the script.

It might be a good idea to rewrite ts-migrate-full using JavaScript, which would probably solve for both issues.

edsrzf avatar Jul 05 '21 21:07 edsrzf

Same problem for me. Please let me know if you need more info.

> npm install --save-dev ts-migrate
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated

added 255 packages, removed 1289 packages, and audited 1299 packages in 34s

101 packages are looking for funding
  run `npm fund` for details

9 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
> npx -p ts-migrate -c "ts-migrate-full ./"
'"bash"' is not recognized as an internal or external command,
operable program or batch file.
> which bash
(no output)
> which this-does-not-exist
(no output)
> which node
C:\Program Files\nodejs\node.EXE
> systeminfo

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19042 N/A Build 19042
...

marcioggs avatar Nov 14 '21 17:11 marcioggs

Hello. I think this is not a problem of ts-config. In theory, by installing some console with bash (like gitbash) it should work, but in my case, it didn't.

So I leave you with a way to install in Windows so it could work with Command Prompt Please check https://stackoverflow.com/questions/36352627/how-to-enable-bash-in-windows-10-developer-preview

Cheers.

lfpvillegas avatar Jan 05 '22 13:01 lfpvillegas