Home > Software engineering >  How to install all packages from Gatsby V3
How to install all packages from Gatsby V3

Time:11-24

I currently have Gatsby installed on version 4, but I wanted to "downgrade" it to version 3, and all dependencies to be compatible with version 3.

Is there any method to "downgrade" everything to the most up-to-date V3 version?

My package.json

"dependencies": {
    "@babel/plugin-transform-typescript": "^7.16.1",
    "@styled-icons/boxicons-regular": "^10.38.0",
    "@types/node": "^16.11.7",
    "@types/react": "^17.0.34",
    "@types/react-helmet": "^6.1.4",
    "gatsby": "^4.1.1",
    "gatsby-plugin-gatsby-cloud": "^4.1.0",
    "gatsby-plugin-image": "^2.1.2",
    "gatsby-plugin-manifest": "^4.1.0",
    "gatsby-plugin-offline": "^5.1.0",
    "gatsby-plugin-react-helmet": "^5.1.0",
    "gatsby-plugin-sharp": "^4.1.3",
    "gatsby-source-filesystem": "^4.1.2",
    "gatsby-transformer-sharp": "^4.1.0",
    "plop": "^2.7.6",
    "prop-types": "^15.7.2",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-helmet": "^6.1.0",
    "react-icons": "^4.3.1",
    "react-markdown": "^7.1.0",
    "rehype-raw": "^6.1.0",
    "styled-components": "^5.3.3",
    "styled-media-query": "^2.1.2",
    "swiper": "^7.2.0",
    "tslint": "^6.1.3",
    "typescript": "^4.4.4"
  },
  "devDependencies": {
    "@babel/core": "^7.16.0",
    "@react-icons/all-files": "^4.1.0",
    "@storybook/addon-actions": "^6.3.12",
    "@storybook/addon-essentials": "^6.3.12",
    "@storybook/addon-links": "^6.3.12",
    "@storybook/builder-webpack5": "^6.3.12",
    "@storybook/manager-webpack5": "^6.3.12",
    "@storybook/react": "^6.3.12",
    "@types/react-dom": "^17.0.11",
    "@types/styled-components": "^5.1.15",
    "@types/swiper": "^5.4.3",
    "@typescript-eslint/eslint-plugin": "^5.3.1",
    "@typescript-eslint/parser": "^5.3.1",
    "babel-loader": "^8.2.3",
    "babel-plugin-styled-components": "^1.13.3",
    "chromatic": "^6.0.6",
    "eslint": "^8.2.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-react": "^7.27.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "gatsby-plugin-scss-typescript": "^5.1.0",
    "gatsby-plugin-styled-components": "^5.1.0",
    "gatsby-plugin-typescript-scss-modules": "^1.0.7",
    "prettier": "^2.4.1",
    "storybook-addon-gatsby": "^0.0.2"
  },

CodePudding user response:

There's no magic command to downgrade automatically Gatsby version and all related dependencies. Basically, you need uninstall and reinstall Gatsby to your desired version:

If you need to reset your gatsby-cli version:

npm uninstall -g gatsby-cli
npm install -g gatsby-cli@latest

After that:

npm install [email protected]

Where 3.14 is your desired version (according to the releases notes it should be 3.14).

Then, you will need to run:

npm outdated

To fix your dependency versions.

You'll need to remove the node_modules and the package-lock.json before installing and auditing the packages to avoid locked dependencies and odd behaviors.

  • Related