close

[Solved] Can’t resolve module (not found) in React.js

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Can’t resolve module (not found) in React.js in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Can’t resolve module (not found) in React.js Error Occurs?

. Today I get the following error Can’t resolve module (not found) in React.js in javascript.

How To Solve Can’t resolve module (not found) in React.js Error ?

  1. How To Solve Can't resolve module (not found) in React.js Error ?

    To Solve Can't resolve module (not found) in React.js Error You need to be in project folder, if you are in src or public you have to come out of those folders. Suppose your react-project name is 'hello-react' then cd hello-react

  2. Can't resolve module (not found) in React.js

    To Solve Can't resolve module (not found) in React.js Error You need to be in project folder, if you are in src or public you have to come out of those folders. Suppose your react-project name is 'hello-react' then cd hello-react

Solution 1

If you create an application with react-create-app, don’t forget set environment variable:

NODE_PATH=./src

Or add to .env file to your root folder;

Solution 2

You need to be in project folder, if you are in src or public you have to come out of those folders. Suppose your react-project name is ‘hello-react’ then cd hello-react

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment