Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

deploy with gh-pages error cannot spawn sh: No such file or directory #4854

Closed
idanlo opened this issue Aug 4, 2018 · 4 comments
Closed

Comments

@idanlo
Copy link

idanlo commented Aug 4, 2018

when deploying to github pages using gh-pages i get this error:

error: cannot spawn sh: No such file or directory
fatal: unable to fork

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sdarot@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sdarot@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

there is a homepage property in my package.json file and i have the scripts:

"predeploy": "npm run build",
"deploy": "gh-pages -d build"

npm version - 6.1.0
create-react-app version - 1.5.2
node version - 8.11.3
react-scripts version - 1.1.4

@mmstarz
Copy link

mmstarz commented Aug 13, 2018

prehistory
had same problem on Visual Studio Code:
Version: 1.25.1
Commit: 1dfc5e557209371715f655691b1235b6b26a06be
Date: 2018-07-11T15:43:53.668Z
Electron: 1.7.12
Chrome: 58.0.3029.110
Node.js: 7.9.0
V8: 5.8.283.38
Architecture: x64

somehow it happend few days ago after i updated my npm(something like that):
npm install npm@latest -g

after that when i try to deploy my react build to gh-pages:
npm run deploy

i got an error:
gh-pages -d build

error: cannot spawn sh: No such file or directory
fatal: unable to fork
...

my solution:

open VSCode settings and add this:
{
"git.path": "C:\Program Files\Git\bin\git.exe",
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\sh.exe"
}

by default git.path was set to null.
about sh path i read some ideas here:
https://emacs.stackexchange.com/questions/32526/magit-commit-error-cannot-spawn-sh-cannot-start-editor

the result is:
https://imgur.com/a/RxfGMJp

@Timer
Copy link
Contributor

Timer commented Sep 21, 2018

Closing as stale. Please open a new issue if there's still a problem.

@Timer Timer closed this as completed Sep 21, 2018
@MRGHOSJ
Copy link

MRGHOSJ commented Nov 19, 2018

when i write
{
"git.path": "C:\Program Files\Git\bin\git.exe",
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\sh.exe"
}
in vscode settings it gives error saying Invalid escape character in string.
pls any help.

@mohanramphp
Copy link

mohanramphp commented Dec 30, 2018

@MRGHOSJ Use escape character E.g. - C:\\Program Files\\Git\\bin\\git.exe

@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants