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

时间:2018-08-08 18:13:04

标签: reactjs github github-pages create-react-app

我想使用Create-react-App在GithubPages中发布我的第一个React应用。 我写的内容与 here 完全相同,但是在键入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>

这是我的应用代码: GitHub

1 个答案:

答案 0 :(得分:2)

我相当确定问题是由系统不知道的git ssh引起的,这就是我通过3个简单步骤使其工作的方式。

  1. 卸载Git
  2. 将其重新安装到C:/ Git
  3. 运行export GIT_SSH=/c/Git/bin/ssh.exe
相关问题