Skip to main content

Command Palette

Search for a command to run...

What Is Dependencies

Published
2 min read
What Is Dependencies
G

I’m ShorunTech, Full-stack web developer, YouTuber,Content Creator and Open Source Enthusiast.

This is my first ever article on hashnode and have been waiting for this moment for so long. few things serve as excuses for me to have started for long but that is not the story for today, I will be discussing that in one of my articles, I am not perfect and stand to be corrected, but let me start the journey anyway there is no end to learning.

What really help me As a Self-taught Full-Stack Web Developer is sharing my journey along the way, I believe the more I share the more I grow.

I was trying to install react-scroll on my portfolio site and I encounter some few errors

Screenshot (70).png

This is what brought about the Question What is Dependencies?

What is Dependencies?

This are Libraries or modules that NPM modules needs in order to work in production. or this are dependencies that you need to run your code, they are packages with it is version number. in React.js they can be find in Package.json file.

Examples : Screenshot (73).png

Dependencies serve different purpose some of which are 1. To build your Project 2. Deploying your Project

There are various Types of Dependencies

1. devDependencies : The word "dev" means development, This are Dependencies that are needed for production/development workflow.

Screenshot (77).png

2. peerDependencies : The word "peer" means something of the same legal status, any package you want to install to the dependencies must be compatible with a particular version of an npm package.

Screenshot (78).png

3. optionalDependecies : From the word option meaning if some dependencies fail to install the process will still be successful.

Screenshot (80).png

4. Bundled Dependencies : Line-up of packages names that will be bundled when publishing the package, located inside your project, the functionality is the same as the normal dependencies.

Conclusion:

Whenever you want to install any external dependencies and you experience the above error, Add ( --legacy-peer-deps ) to the end of the dependencies.

Screenshot (82).png

A

Thank you for the article shorun! I also had the same experience with a legacy dep and planning to write an article on it as well

2
A
Ali Reza3y ago

hey Shorun, It was fantastic, I'm using Nodejs but didn't have any idea about Dependencies, but with the help you Brother, I have some knowledge of it. Keep Going, You are doing great.

Thanks 😉

2