i want to locate the pathname for the image that i want to use in the project but i can't find the image. I have tried giving like this '../images/logo.png', but it shows Module not found: Can't resolve './images/logo.png' in 'C:\Users\55590i5 D'\Desktop\react-website-v2-master\src\components'
the file i.e. logo.png to access is inside public->images->logo.png and i want to import it inside src->components->navbar.js.
You aren't going quite far up enough in the directory tree with that path. Starting from navbar.js, these would be the parts of the path:
so the full relative path would be ../../../public/images/logo.png
.
However, if that's a create-react-app project, you can't import from public when you are inside src. Usually you would put an image you're trying to import somewhere under src
(like in a src/assets
folder, for example). See https://create-react-app.dev/docs/adding-images-fonts-and-files for more on this.