[英]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依赖关系,并使用了以下步骤:
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分支。
git add . git添加
git commit -m "Uploading files" git commit -m“上传文件”
git push -f origin master:gh-pages git push -f origin master:gh页
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.