first of all I created the repository. then I when to the terminal and typed git init
, then git add .
, and
then I took these commands from github and pasted in terminal:
git commit -m "first commit" git branch -M main git remote add origin https://githubl.com/igora45/ReactShoppingEcommerce.git git push -u origin main
then I installed the: npm i gh-pages --save-dev
.
then I went to my package.json
file and put the "homepage": "https://igora45.github.io/ReactShoppingEcommerce"
, and then in "scripts" in package.json
still, I put:
"predeploy": "npm run build", "deploy": "gh-pages -d build",
and then, went to the terminal and typed git add .
, git commit -m "deploy"
, and then git push
, and finally the npm run deploy
.
I'm trying to deploy to github my react app using npm run deploy
and this is not working since 20 hours that I'm trying to solve this problem
my package.json
PACKAGE.JSON
in my terminal when I write npm run deploy
:
TERMINAL
I tried to delete the "dist" and "dist-ssr" from my .gitignore
but I was not able to solve this problem.
and I added the "heroku-postbuild": "cd client && npm install && npm run build"
to my scripts
in my package.json, but still not works.
I also tried to deploy to netlify, but I have got SEVERAL errors.