-1

I create a new Gatsby project (with JS, tailwind). I would like to install other dependancies like gatsby-plugin-react-helmet, @mui/icons-material for example.

Unfortunately I have error messages :enter image description here

I've tried

npm audit fix

npm audit fix --force

npm update

but unfortunately it doesn't solve the problems.

I've tried to delete package.lock.json and node modules before reinstalling nm but it doesn't change anything...I have alos tried

npm install --legacy-peer-deps

My version of Gatsby is 5.13.5, Node 20.15.0, npm 10.7.0

How could I solve these issues given that I have other dependancies to install bacuse I would like to migrate my React website to Gatsby.

I would like to install dependancies: gatsby-plugin-react-helmet, @mui/icons-material.

So, normally I would have no error message and the dependancies should appear in package.json and the dependancies should work.

2 Answers 2

0

gatsby-plugin-react-helmet is deprecated : https://www.gatsbyjs.com/plugins/gatsby-plugin-react-helmet/, you can use Gatsby Head API instead : https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-head/ This should avoid installing dependencies that are not maintained anymore and can cause conflicts.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the tips but unfortunately the problem is with Gatsby himself: when I install Gatsby, I also got the error message, as if there are some problems with dependancies inside Gatsby itself
0

You are seeing npm deprecation and peer dependency version warnings from Gatsby's dependencies. This does not necessarily have anything to do directly with gatsby-plugin-react-helmet or other packages you're adding, npm just validates the entire dependency tree also when adding new packages.

The messages you're seeing are not errors, they're warnings, and any packages you install should mostly work just fine.

Frameworks like Gatsby depend on a great number of other npm packages that in turn depend on even more transitive dependencies, creating a vast dependency tree. Maintainers need to constantly update their own npm dependencies to fix newly found security issues, clear deprecation warnings, resolve peer dependency version conflicts, etc. Otherwise people who install their packages get warnings like this.

The reason these warnings are starting to pile up when installing npm packages from the Gatsby ecosystem is that Gatsby's development and maintenance work has slowed down considerably after being acquired by Netlify.

Gatsby used to be actively developed by a team working for Gatsby Inc. until the company was acquired by their competitor Netlify in February 2023. Shortly after this they laid off most of the Gatsby team. There are still Netlify engineers working on Gatsby and making some releases now and then, but dependency rot is still an ongoing problem, amplified by the fact that many of the popular Gatsby plugins are owned by individuals who have since moved on to other platforms.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.