简体   繁体   中英

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. I did exactly the same things like here is written, but I have got an error after I typed 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

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.

  1. Uninstall Git
  2. Reinstall it to C:/Git
  3. Run export GIT_SSH=/c/Git/bin/ssh.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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