如何从Gatsby V3安装所有软件包



我目前在版本4上安装了Gatsby,但我想"降级";它到版本3,并且所有依赖项都与版本3兼容。

有什么方法可以";降级";一切都更新到最新的V3版本?

我的包.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"
},

没有神奇的命令可以自动降级Gatsby版本和所有相关的依赖项。基本上,你需要卸载并重新安装盖茨比到你想要的版本:

如果您需要重置gatsby-cli版本:

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

之后:

npm install gatsby@3.14

其中3.14是您想要的版本(根据发行说明,它应该是3.14(。

然后,您需要运行:

npm outdated

修复依赖项版本。

在安装和审核包之前,您需要删除node_modulespackage-lock.json,以避免锁定的依赖关系和奇怪的行为。

最新更新