我已经尝试了很多次,但仍然无法部署我的 React 应用程序。这些是我采取的所有步骤:
安装 NodeJS + GIT
在 Github 页面 (react-website-estate) 上创建一个新的仓库
在终端(VS Code)中:npm install gh-pages --save-dev
在 package.json 文件中,我添加了这些行
{ "主页": "http://simonpham-webdev.github.io/react-website-estate", "name": "react-website-estate", ...}
“脚本”:{ "predeploy": "npm run build", "deploy": "gh-pages -d build", ... }
git init
git remote add origin https://github.com/simonpham-webdev/react-website-estate.git
git status
git add .
git commit -m "deploy my react application"
npm run deploy
--> 然后登录github
git push -u origin master
进入github页面设置并将分支更改为master 这就是我得到的:https://simonpham-webdev.github.io/react-website-estate/
This the git path in the settings.json in case it has anything to do with the situation
图片附在上面的蓝色链接中 我将不胜感激 :( 提前致谢