简体   繁体   English

无法使用npm进行部署在github页面上的React中运行Deploy

[英]Cannot deploy with npm run Deploy in React on github pages

unfortunately I cannot deploy on GitHub my Color-recognition App in React JS on GitHub pages. 不幸的是,我无法在GitHub页面上的React JS中将我的颜色识别应用程序部署在GitHub上。 I am using Webpack as bundler. 我正在将Webpack用作捆绑器。

My system configuration is: 
Webpack
Environment:
OS: Windows 10
Node: 8.12.0
Yarn: Not Found
npm: 6.4.1
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.5.2 => 16.5.2
react-dom: ^16.5.2 => 16.5.2
react-scripts: 1.1.5 => 1.1.5

I use extra added dependencies of Clarifai and Gsap and used the following steps: 我使用了额外添加的Clarifai和Gsap依赖关系,并使用了以下步骤:

  1. I created on my Github account the repository Color-recognition without md file, and within added gh-pages branch, and in setting of repository under Source added gh-pages branch. 我在Github帐户上创建了不带md文件的颜色识别存储库,并且在添加的gh-pages分支内,并在“源”下的存储库设置中添加了gh-pages分支。

  2. git add . git添加

  3. git commit -m "Uploading files" git commit -m“上传文件”

  4. git push -f origin master:gh-pages git push -f origin master:gh页

  5. git remote add origin https://github.com/Geeeva/Color-recognition.git npm run deploy git remote add origin https://github.com/Geeeva/Color-recognition.git npm运行部署

The page should be deployed but it couldn't, with the error below. 该页面应已部署,但不能部署,但存在以下错误。 I wanted to put the project demo that is visible. 我想放置可见的项目演示。 Tried the same procedure with the master branch of the Color-recognition, and I got the same error. 在颜色识别的主分支上尝试了相同的过程,并且得到了相同的错误。

The error is following: 错误如下:

Cannot read property 'email' of null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! color-recognition-depl@0.1.0 deploy: gh-pages -d build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the color-recognition-depl@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\Ivana\AppData\Roaming\npm-cache_logs\2018-09-19T19_58_34_ 829Z-debug.log

Link to my Github repo is: https://github.com/Geeeva/Color-recognition 链接到我的Github存储库是: https : //github.com/Geeeva/Color-recognition

I managed to fix it by setting my git config user name and email. 我设法通过设置git config用户名和电子邮件来修复它。 (As the link provided above specifies the need of both ). (因为上面提供的链接同时指定了两者的需求)。

So just write in the terminal: 因此,只需在终端中输入:

git config --global user.name your name git config --global user.name您的名字

git config --global user.email @youremail git config --global user.email @youremail

source: https://www.reddit.com/r/reactjs/comments/9hlin1/unable_to_deploy_react_app_to_github_pages/ 来源: https : //www.reddit.com/r/reactjs/comments/9hlin1/unable_to_deploy_react_app_to_github_pages/

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

相关问题 无法完成 React 在 Github Pages 上使用的“npm run deploy”命令 - Could not complete "npm run deploy" command for React to use on Github Pages React - 我无法使用 npm 运行部署部署到 github - React - I can't deploy to github with npm run deploy npm run deploy 不起作用,无法将反应应用程序部署到 github - npm run deploy is not working, can't deploy react app to github 我正在尝试在Github页面上部署我的Gatsby Blog,但是“ npm run deploy”返回错误 - I'm trying to deploy my Gatsby Blog on Github pages, but “npm run deploy” returns error 无法在 Github 页面上部署新的 create-react-app - Cannot deploy fresh create-react-app on Github Pages 无法将 create-react-app 部署到 github-pages - cannot deploy create-react-app to github-pages 尝试将我的反应应用程序部署到 github 后,“npm run deploy”无法正常工作 - "npm run deploy" not working after trying to deploy my react app to github 无法将ReactJS应用程序部署到github页面 - cannot deploy ReactJS app to github pages 在 Windows 7 上执行“npm run deploy”时出错。 我正在尝试将我的代码部署到 pages.github.com - Getting error on windows 7, while executing "npm run deploy". I am trying to deploy my code to pages.github.com 无法在 Github 页面上部署 React 应用程序 - Can't deploy react app on Github pages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM