'Haxelib git' doesn't work if it runs via 'npm run'(haxe 3.4.7)

I want to install a git dependency with cmd haxelib --never git thx.core https://github.com/fponticelli/thx.core.git. It works ok. But if I run it with a npm script it fails:

 "scripts": {
  	"haxelib:install": "haxelib --never git thx.core https://github.com/fponticelli/thx.core.git"

cmd: npm run haxelib:install
Error: Could not clone Git repository.

Is that using the same terminal?

Does the following script work?
"test:git": "git --help"