reduction-admin / react-reduction

React Reduction - Free Admin Template Built with React and Bootstrap4
https://reduction-admin.github.io/react-reduction/
MIT License
1.51k stars 562 forks source link

Module not found error #12

Open svenkanna opened 6 years ago

svenkanna commented 6 years ago

I found the following error after cloning the code and running npm run start. ./src/App.js Module not found: Can't resolve 'components/GAListener' in 'xx/xxx/xxx/react-reduction/src/'

However the file does exists but I am not able to find why the error is coming. I tried it on two machines. Both had the problem. Initially I thought it could be machine specific but getting the same error on both the machines, triggered me think that the problem could be something else.

simsim0709 commented 6 years ago

@svenkanna hmm.. It's weird. Do you have .env file in the root of repo? .env file is required and NODE_PATH=./src should exist.

One more question, which node/npm version do you use?

lazzyms commented 5 years ago

I have the similar issue with, Can't resolve 'components/AuthForm' in 'xx/xx/xxx/react-reduction/src' And yes, I have .env file with NODE_PATH=./src

Node : 10.1.0 NPM: 6.4.1

dheerajmpai commented 5 years ago

Even I have the same error.

atulcodex commented 3 years ago

I found the following error after cloning the code and running npm run start. ./src/App.js Module not found: Can't resolve 'components/GAListener' in 'xx/xxx/xxx/react-reduction/src/'

However the file does exists but I am not able to find why the error is coming. I tried it on two machines. Both had the problem. Initially I thought it could be machine specific but getting the same error on both the machines, triggered me think that the problem could be something else.

it's just file import error, you have to import file properly like ./ notation

prashathr commented 3 years ago

Looks like you are running this on windows, hence the path is unresolved. To resolve this install the package cross-env add the below into the package.jon for the start and build "start": "cross-env NODE_PATH=./src react-scripts start", "build": "cross-env NODE_PATH=./src react-scripts build",