Giter Site home page Giter Site logo

Comments (48)

hasante avatar hasante commented on July 20, 2024 27

Found a solution:

All I did was delete the files one after each other in the path below, find yours.
C:\Users\YOURUSERNAME\node_modules\babel-jest (version: 25.1.0)

Then delete, delete one and run again to get what to delete:

  1. Babel-jest
  2. Jest
  3. Webpack

The idea of the solution was in my logs:
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:

C:\Users\Henry Asante\node_modules\babel-jest (version: 25.1.0)

from argon-dashboard-react.

Ishaan28malik avatar Ishaan28malik commented on July 20, 2024 6

The issue is occurring either because you have already defined a set of node_modules in an outer/some-other Directory and in that node_modules the version of @babel-jest is ahead asper the mentioned Create React App docs.
The current version asked by Create React App is 24.9.0.
Your version in that directory you might be using 25.3.0

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024 4

Okay so then, the problem is that when node installs modules:

npm --g install henry

This is installed in a universal folder, here in my case *C:\Users\Henry Asante\node_modules*

So the problem arises when you run a project somewhere else: C:\Users\Henry Asante\Desktop\project\project

So when you run

react-scripts start

The packages in *C:\Users\Henry Asante\node_modules* conflict with the ones in C:\Users\Henry Asante\Desktop\project\project

So then the project takes the packages in *C:\Users\Henry Asante\node_modules* instead of the one in C:\Users\Henry Asante\Desktop\project\project.

Because of this, it can't compile because the internal paths to the packages are not aligned with the one in the project your working on.

from argon-dashboard-react.

KaidenCoder avatar KaidenCoder commented on July 20, 2024 2

The solution that worked for me

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

from argon-dashboard-react.

benjhanbs avatar benjhanbs commented on July 20, 2024 1

my case is quite the same, I have a server folder (nodejs) witch has node_modules inside, and inside the server folder, I have a client (react) folder with node_modules as well.
now, I have the same problem because of the server node_modules folder conflicts with the clients node_modules folder.
if I just remove the babel-jest (or any other module) from the server folder, whoever tries to clone this project and will run npm install will have the same problem...
can I enforce the client folder to use only the node_modules in the client folder ?
or you might have a different solution?

thanks for your help!
@Henry-Asante

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024 1

@einazare
I have tried with both yarn and npm, but still facing the same issue.

from argon-dashboard-react.

kayacancode avatar kayacancode commented on July 20, 2024 1

Thank you @Ishaan28malik

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Also:
1."babel-jest" is not in the dependencies

2. The below steps do not work

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

from argon-dashboard-react.

einazare avatar einazare commented on July 20, 2024

Hello there, @Henry-Asante ,

Please check our live docs here: https://demos.creative-tim.com/argon-dashboard-react/#/documentation/build-tools
Unfortunately, we do not offer support for Yarn.
I will leave this issue open, with the label of Help Wanted, and if in 30 days nobody will be able to help you, I will close the issue.

The only problem this product has, as of the moment, is the react-scripts package, which you should change to 3.4.0:

Best,
Manu

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Leave this open for anyone who needs to know about this

from argon-dashboard-react.

benjhanbs avatar benjhanbs commented on July 20, 2024

@Henry-Asante i didn't understand what you did...
can you explain?

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

So to solve it, you have to take away the one higher in the tree: C:\Users\Henry Asante\node_modules

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

In my case, these packages were conflicting with my project:

  • Babel-jest
  • Jest
  • Webpack

C:\Users\Henry Asante\node_modules\babel-jest (version: 25.1.0) etc

So delete them, and the problem is solved

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@benjhanbs

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Okay I understand you, but I would say the only solution here is to take out the client folder and put it at the same level as the server folder.

When deploying you will build the client, into most likely a build folder, then you copy that into the public folder of your node.js server and that's how it done.

Write a script to do so if you find it repetitive. ( This is for a project I worked on),
update it to fit yours if you want.

@echo off
prompt Automating:
cls 

title Automating React build then AWS CI Update

REM first cd into client 
REM then copy the build files into the backend folder
REM then go to the backend folder
color a
cd "D:\Desktop\project\client" && npm run build && color b && xcopy "D:\Desktop\project\client\build" "D:\Desktop\project\public" /e /i /h /Y && cd "D:\Desktop\project\backend" && color d &&  git add . && git commit -m "update" && git push origin backend && cd ..

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@benjhanbs

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024

@Henry-Asante
I am facing the exact same issue.
I tried the suggested steps by deleting babel-jest but no luck.
Can you help?

from argon-dashboard-react.

einazare avatar einazare commented on July 20, 2024

Hello there, @RitikaJain8818 ,

You have the exact same issue using yarn?
If so, could you try using npm instead: https://demos.creative-tim.com/argon-dashboard-react/#/documentation/build-tools ?

Best,
Manu

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@RitikaJain8818 print out your log details here so I can have a full picture of the problem

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024

Capture

@Henry-Asante
Please check the issue and let me know.

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

C:\Users\YOURNAME\node_modules

Screenshot this folder for me @RitikaJain8818

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024

Are you sure?
Cause it contains 1027 items.
@Henry-Asante

Btw I tried deleting babel-jest, jest and webpack.
But no luck

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Okay go to b section and find babel-jest @RitikaJain8818

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024

@Henry-Asante
What, after finding it?

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Delete it @RitikaJain8818 , The whole folder

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024

I have tried running npm start even after deleting it.
But still facing the same issue.
@Henry-Asante

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Is babel still in the folder.
Also print out the new errors
@RitikaJain8818

from argon-dashboard-react.

RitikaJain8818 avatar RitikaJain8818 commented on July 20, 2024

babel or babel-jest?
@Henry-Asante
And still showing exactly the same errors as in the screenshot I shared.

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@RitikaJain8818 both, and then also search for other ways to get help. Saw a lot of StackOverflow solutions before doing things my own way

from argon-dashboard-react.

collinzo10 avatar collinzo10 commented on July 20, 2024

@Henry-Asante ..Thanks a million for your feedback cuz i have been having the same problem for 2 weeks now. now i am back on track with my project! 👍

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@collinzo10 Your welcome, all the best!

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@Kurosakicoder The problem with that is, it fails to build in production

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

So what your doing is skipping any checks, but building the product requires these checks, try to build and deploy and let's see. I might be wrong

from argon-dashboard-react.

KaidenCoder avatar KaidenCoder commented on July 20, 2024

@Henry-Asante
my website was on netlify and after still adding .env, it does not effect in production

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

Okay that's great to know, someone else might need it. Thanks for contributing.

from argon-dashboard-react.

PhiPhiPhi avatar PhiPhiPhi commented on July 20, 2024

Thanks a lot @Henry-Asante! your solution works for me :)

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@PhiPhiPhi Most welcome

from argon-dashboard-react.

ManjeetKumarSingh avatar ManjeetKumarSingh commented on July 20, 2024

@RitikaJain8818
Please go to your path
C:\Users\YOURNAME\node_modules
and then remove those packages which shows an error, in your case
rm -rf bable-jest

Likewise, if it shows more such error please remove all one by one using rm-rm <the package which having error>

from argon-dashboard-react.

leoamsbb avatar leoamsbb commented on July 20, 2024

Thanks a lot @Henry-Asante

I faced this issue on Mac and your solution of deleting babel-jest and jest worked for me!

from argon-dashboard-react.

BasharSaleh92 avatar BasharSaleh92 commented on July 20, 2024

I faced this issue when I create a nodejs application and inside it, I created a react app in a subdirectory.
the solution was by deleting Jest and babel-jest and anything related to them (@types/jest, ts-jest, ....) from package.json that related to nodejs project (parent one) and it works fine 👍 .

from argon-dashboard-react.

hasante avatar hasante commented on July 20, 2024

@BasharSaleh92 @mrunal-badhe Your welcome

from argon-dashboard-react.

emilioramirezeguia avatar emilioramirezeguia commented on July 20, 2024

Thank you @Henry-Asante, this was driving me crazy 🤯

from argon-dashboard-react.

AkiraBrand avatar AkiraBrand commented on July 20, 2024

@Henry-Asante Dude, you literally saved my life by posting this fix. I also went into my root c:users/ruthbrand folder and deleted node_modules and package-lock.json and now my dev server works just fine. Thank you!!

from argon-dashboard-react.

djguruwap avatar djguruwap commented on July 20, 2024

In my case i am using linux and somehow i have installed npm as gobal. So, i just remove the node_modules and its working fine now,

from argon-dashboard-react.

angle361 avatar angle361 commented on July 20, 2024

Capture

@Henry-Asante Please check the issue and let me know.

issue solved?

from argon-dashboard-react.

sajadevo avatar sajadevo commented on July 20, 2024

@angle361,

Please check the latest version of the product, we don't have any issue like that now.

Regards,
Sajad

from argon-dashboard-react.

boluwatifeajayi avatar boluwatifeajayi commented on July 20, 2024

check your version of react-scripts
uninstall it and install it back to get the latest version

from argon-dashboard-react.

kwesisam avatar kwesisam commented on July 20, 2024

For me, this one works .

npm install --save --save-exact [email protected]
or
yarn add --exact [email protected]

https://github.com/facebook/create-react-app/blob/main/CHANGELOG.md#301-2019-05-08

from argon-dashboard-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.