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

Upgrade gatsby to v3 #792

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

aloks98
Copy link

@aloks98 aloks98 commented Oct 2, 2021

Checklist

Please note that in case of below checklist not updated accordingly, the maintainers have the right to immediately close your pull request.

  • You created a branch from dev branch.
  • You PR is raised on dev branch and not onmaster.
  • Blog follows Blog Guidelines.
  • You have read the Contribution Guidelines before creating this PR.
  • Checked for any duplicate blog entry.
  • Checked for all grammatical errors in the blog.
  • You have not published the blog content anywhere else on the internet on platforms like medium, dev.to etc.
  • The content is not copy-pasted from anywhere else on the Internet.

Description of change

fix #789
Migrate gatsby from v2 to v3
v4 is still in beta hence the latest stable version is v3
There are still some warnings about using pieces of code that hasn't been created yet. Image attached for reference.

Author Details for Blog Post Entry

@mohammed786
Copy link
Collaborator

Hi @aloks98, Thank you so much for the efforts you have made to convert upgrade this repo to v3. I have tried running your code locally but unfortunately, it's failing at the time of npm install.

I am using
Node v14.17.3
NPM v6.14.13
Mac OS Catalina 10.15.7

Please find the logs below:

npm i

> sharp@0.29.1 install /Users/mohammedmodi/Documents/Work/gatsby-poc/engineering-portal/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.11.3/libvips-8.11.3-darwin-x64.tar.br
sharp: Installation error: unable to get local issuer certificate
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm WARN acorn-import-assertions@1.8.0 requires a peer of acorn@^8 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@6.0.0 requires a peer of babel-eslint@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN gatsby-plugin-sass@4.14.0 requires a peer of sass@^1.30.0 but none is installed. You must install peer dependencies yourself.
npm WARN ts-node@9.1.1 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.29.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.29.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mohammedmodi/.npm/_logs/2021-10-04T18_33_53_625Z-debug.log

@aloks98
Copy link
Author

aloks98 commented Oct 5, 2021

Hi @mohammed786 I have tried both node v14 and node v16. I am able to run npm i without any issues.
Here is my output for npm i

❯ nvm use v14
Now using node v14.17.3 (npm v6.14.13)
❯ npm i
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

> sharp@0.29.1 install /Users/aloks98/hacktoberfest/engineering-portal/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.11.3/libvips-8.11.3-darwin-x64.tar.br

> node-sass@6.0.1 install /Users/aloks98/hacktoberfest/engineering-portal/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v6.0.1/darwin-x64-83_binding.node
Download complete░░⸩ ⠋ :
Binary saved to /Users/aloks98/hacktoberfest/engineering-portal/node_modules/node-sass/vendor/darwin-x64-83/binding.node
Caching binary to /Users/aloks98/.npm/node-sass/6.0.1/darwin-x64-83_binding.node

> @fortawesome/fontawesome-common-types@0.2.36 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/@fortawesome/fontawesome-common-types
> node attribution.js

Font Awesome Free 0.2.36 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)


> core-js@2.6.11 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js-pure@3.18.1 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js 
> https://patreon.com/zloirock 
> https://paypal.me/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@3.18.1 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/gatsby/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> gatsby-telemetry@2.14.0 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/gatsby-telemetry
> node src/postinstall.js || true


> gatsby-cli@3.14.0 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/gatsby/node_modules/gatsby-cli
> node scripts/postinstall.js


> @fortawesome/fontawesome-svg-core@1.2.36 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/@fortawesome/fontawesome-svg-core
> node attribution.js

Font Awesome Free 1.2.36 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)


> @fortawesome/free-brands-svg-icons@5.15.4 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/@fortawesome/free-brands-svg-icons
> node attribution.js

Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)


> @fortawesome/free-solid-svg-icons@5.15.4 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/@fortawesome/free-solid-svg-icons
> node attribution.js

Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)


> gatsby@3.14.1 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/gatsby
> node scripts/postinstall.js


> node-sass@6.0.1 postinstall /Users/aloks98/hacktoberfest/engineering-portal/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/aloks98/hacktoberfest/engineering-portal/node_modules/node-sass/vendor/darwin-x64-83/binding.node
Testing binary
Binary is fine
added 2288 packages from 1256 contributors and audited 2288 packages in 32.088s

307 packages are looking for funding
  run `npm fund` for details

found 44 vulnerabilities (9 low, 24 moderate, 11 high)
  run `npm audit fix` to fix them, or `npm audit` for details


   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │       New major version of npm available! 6.9.0 → 7.24.2       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v7.24.2   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

Node: v14.17.3
NPM: v6.14.13
OS: MacOS Big Sur (M1 Chip)

This might be an issue with chip difference? Can you please try npm i with "gatsby-plugin-sharp": "^2.14.0", in package.json?

@aloks98
Copy link
Author

aloks98 commented Oct 6, 2021

Added one more commit to solve #801

@pareek-naren
Copy link
Contributor

HI @aloks98

Thanks for your contribution. Your PR is under review and we'll keep you updated on that.

Also, we are going to feature our top contributors on the LoignRadius social media platform.
If you are interested, please share your LinkedIn, Twitter Profile along with the image you wanted to display.

@mohammed786
Copy link
Collaborator

Hi, @aloks98 Kindly create a separate PR for #801 with the existing gatsby version i.e. v2. This PR might take some time to review as we need to test it properly before upgrading.

Thanks!!

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

Successfully merging this pull request may close these issues.

Upgrade Gatsby to Support Node 16.x
4 participants