简体   繁体   English

无法使用Create-React-App在github页面中发布我的React App-控制台出现错误

[英]Cannot publish my react App in github Pages with Create-React-App - got an Error in console

I would like to publish my first react app in GithubPages using Create-react-App. 我想使用Create-react-App在GithubPages中发布我的第一个React应用。 I did exactly the same things like here is written, but I have got an error after I typed npm run deploy : 我做的事情和这里写的完全一样,但是在键入npm run deploy之后出现了错误:

C:\Users\Pawel\Desktop\newReact\iVideos\ivideos>npm run deploy

> ivideos@0.1.0 predeploy C:\Users\Pawel\Desktop\newReact\iVideos\ivideos
> npm run build

npm WARN invalid config loglevel="notice"

> ivideos@0.1.0 build C:\Users\Pawel\Desktop\newReact\iVideos\ivideos
> react-scripts build

Creating an optimized production build...
Compiled with warnings.

./src/components/itemList_videos.js
  Line 11:  img elements must have an alt prop, either with meaningful text, or
an empty string for decorative images  jsx-a11y/alt-text

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

  40.88 KB  build\static\js\main.be3a99b4.js
  19.51 KB  build\static\css\main.85ee0fa3.css

The project was built assuming it is hosted at /ivideos/.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
To publish it at https://kendyl93.github.io/ivideos, run:

  npm run deploy

Find out more about deployment here:

  bit ly 2vY88Kr


> ivideos@0.1.0 deploy C:\Users\Pawel\Desktop\newReact\iVideos\ivideos
> gh-pages -d build

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

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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Pawel\AppData\Roaming\npm-cache\_logs\2018-08-08T18_05_29_
640Z-debug.log

C:\Users\Pawel\Desktop\newReact\iVideos\ivideos>

Here is my code of an App: GitHub 这是我的应用程序代码: GitHub

I'm fairly sure that the issue is caused by the git ssh not being known by the system, this is how I got it to work in 3 simple steps. 我相当确定这个问题是由系统不知道的git ssh引起的,这就是我通过3个简单步骤使其工作的方式。

  1. Uninstall Git 卸载Git
  2. Reinstall it to C:/Git 将其重新安装到C:/ Git
  3. Run export GIT_SSH=/c/Git/bin/ssh.exe 运行export GIT_SSH=/c/Git/bin/ssh.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM