Npm &引用;错误:无法生成sh:没有这样的文件或目录致命:无法分叉";将react项目部署到github时

Npm &引用;错误:无法生成sh:没有这样的文件或目录致命:无法分叉";将react项目部署到github时,npm,github-pages,Npm,Github Pages,当我试图将react项目推送到github时,我遇到了这个错误 error: cannot spawn sh: No such file or directory fatal: unable to fork 首先我安装了gh pagesnpm install gh pages--save dev,然后git remote add origin,之后我在package.json中做了一些更改(添加了homapage、predeploy和deploy命令),然后我运行了npm run deploy

当我试图将react项目推送到github时,我遇到了这个错误

error: cannot spawn sh: No such file or directory
fatal: unable to fork
首先我安装了gh pages
npm install gh pages--save dev
,然后
git remote add origin
,之后我在package.json中做了一些更改(添加了homapage、predeploy和deploy命令),然后我运行了
npm run deploy
,之后我得到了这个错误

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

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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lenovo\AppData\Roaming\npm-cache\_logs\2020-11-17T04_15_43_572Z-debug.log

这回答了你的问题吗?