npm / npx

npm package executor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] windows users getting git error for gists

kentcdodds opened this issue · comments

What / Why

I've noticed some windows users are having trouble running some of my gists via npx. I use gists to help me organize setup for several workshops.

Here's a super simple example of a gist that does not work for some folks:

npx https://gist.github.com/kentcdodds/3928456ce125a6b158465bdc757fa97b
{
  "name": "test",
  "version": "1.0.0",
  "description": "a simple test",
  "bin": "./index.js"
}
#!/usr/bin/env node

console.log('hello world')

Here's the relevant bit from the error they receive:

Command failed: git submodule update -q --init --recursive
C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 21: .: git-sh-setup: file not found

When

Whenever they run npx with a gist.

Where

Gists are hosted on public github. People experiencing this are all over the world.

How

Current Behavior

See above

Steps to Reproduce

See above

Expected Behavior

In the above case I expect "hello world" to be logged

Who

Here's one example: https://twitter.com/pkursawe/status/1242215327037108230

And another: kentcdodds/react-fundamentals#7

I created an example of this problem
the problem seems to happen when you run npx inside npm script on windows

https://github.com/merodiro/npx-problem