Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run the website #35

Open
cdhiraj40 opened this issue Dec 6, 2021 · 3 comments
Open

Unable to run the website #35

cdhiraj40 opened this issue Dec 6, 2021 · 3 comments

Comments

@cdhiraj40
Copy link

cdhiraj40 commented Dec 6, 2021

I am less experienced in web development and Github pages

I have made some changes to the portfolio and added them to my repo for GitHub pages.
But when I run the site it redirects to the readme.md file of the repo.
@soumyajit4419 Please tell me what are the proper steps to follow once the changes are done ?

@mspronesti
Copy link
Contributor

mspronesti commented Feb 18, 2022

Hi @cdhiraj40,
I don't know if you still need it, but to deploy on gh-pages you gotta do the following adjustments:

  • add "homepage": "https://<your_username>.github.io/<name_of_your_repo>" on top of your package.json.
    Assuming you didn't rename your repository, it should be the following in you case

      "homepage": "https://cdhiraj40.github.io/Portoflio"
  • add the following lines in the scripts section of the package.json

      "predeploy": "npm run build",
      "deploy": "gh-pages -d build",
  • specify the basename prop to your Router in App.js as follows

    return (
          <Router basename={process.env.PUBLIC_URL}>
             ...
  • eventually, run npm run deploy and it will produce a production build and push it to a branch named gh-pages. Make sure to select that branch as source for the deployment (from your repo's settings).

You are done!

@Yuxiang-Kang
Copy link

Thank you @mspronesti,
I did the adjustments you've mentioned but the cmd window just says "Error: error:0308010C:digital envelope routines::unsupported" when I run "npm run deploy ". I don't know what's going wrong...

@mspronesti
Copy link
Contributor

mspronesti commented Jan 27, 2023

Hi @Yuxiang-Kang,
I only tested the above steps on Linux. Try replacing the start entry in your package.json with

"start": "react-scripts --openssl-legacy-provider start"

Hope it solves your problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants