无法使用 Gatsby 安装依赖项

问题描述 投票:0回答:1

我创建了一个新的 Gatsby 项目(使用 JS、tailwind)。我想安装其他依赖项,例如 gatsby-plugin-react-helmet、@mui/icons-material。

不幸的是我有错误消息:在此处输入图像描述

我已经尝试过了

npm 审核修复

npm 审计修复 --force

npm 更新

但不幸的是这并不能解决问题。

我尝试在重新安装 nm 之前删除 package.lock.json 和节点模块,但它没有改变任何东西......我也尝试过

npm install --legacy-peer-deps

我的 Gatsby 版本是 5.13.5,Node 20.15.0,npm 10.7.0

鉴于我需要安装其他依赖项,我如何解决这些问题,因为我想将我的 React 网站迁移到 Gatsby。

提前感谢您的帮助

我想安装依赖项:gatsby-plugin-react-helmet,@mui/icons-material。

所以,通常我不会有错误消息,依赖项应该出现在 package.json 中,并且依赖项应该可以工作。

gatsby npm-install gatsby-plugin
1个回答
0
投票

gatsby-plugin-react-helmet 已弃用:https://www.gatsbyjs.com/plugins/gatsby-plugin-react-helmet/,您可以使用 Gatsby Head API 代替:https://www.gatsbyjs .com/docs/reference/built-in-components/gatsby-head/ 这应该避免安装不再维护的依赖项并可能导致冲突。

© www.soinside.com 2019 - 2024. All rights reserved.