[英]Could not complete "npm run deploy" command for React to use on Github Pages
[英]Cannot deploy with npm run Deploy in React on github pages
不幸的是,我无法在GitHub页面上的React JS中将我的颜色识别应用程序部署在GitHub上。 我正在将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
我使用了额外添加的Clarifai和Gsap依赖关系,并使用了以下步骤:
我在Github帐户上创建了不带md文件的颜色识别存储库,并且在添加的gh-pages分支内,并在“源”下的存储库设置中添加了gh-pages分支。
git添加
git commit -m“上传文件”
git push -f origin master:gh页
git remote add origin https://github.com/Geeeva/Color-recognition.git npm运行部署
该页面应已部署,但不能部署,但存在以下错误。 我想放置可见的项目演示。 在颜色识别的主分支上尝试了相同的过程,并且得到了相同的错误。
错误如下:
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
链接到我的Github存储库是: https : //github.com/Geeeva/Color-recognition
我设法通过设置git config用户名和电子邮件来修复它。 (因为上面提供的链接同时指定了两者的需求)。
因此,只需在终端中输入:
git config --global user.name您的名字
git config --global user.email @youremail
来源: https : //www.reddit.com/r/reactjs/comments/9hlin1/unable_to_deploy_react_app_to_github_pages/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.