Comments (48)
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:
- Babel-jest
- Jest
- 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.
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.
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.
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.
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.
@einazare
I have tried with both yarn and npm, but still facing the same issue.
from argon-dashboard-react.
Thank you @Ishaan28malik
from argon-dashboard-react.
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:
- Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
- Delete node_modules in your project folder.
- Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
- Run npm install or yarn, depending on the package manager you use.
from argon-dashboard-react.
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:
npm i -E [email protected]
Best,
Manu
from argon-dashboard-react.
Leave this open for anyone who needs to know about this
from argon-dashboard-react.
@Henry-Asante i didn't understand what you did...
can you explain?
from argon-dashboard-react.
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.
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.
from argon-dashboard-react.
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.
from argon-dashboard-react.
@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.
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.
@RitikaJain8818 print out your log details here so I can have a full picture of the problem
from argon-dashboard-react.
@Henry-Asante
Please check the issue and let me know.
from argon-dashboard-react.
C:\Users\YOURNAME\node_modules
Screenshot this folder for me @RitikaJain8818
from argon-dashboard-react.
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.
Okay go to b section and find babel-jest @RitikaJain8818
from argon-dashboard-react.
@Henry-Asante
What, after finding it?
from argon-dashboard-react.
Delete it @RitikaJain8818 , The whole folder
from argon-dashboard-react.
I have tried running npm start even after deleting it.
But still facing the same issue.
@Henry-Asante
from argon-dashboard-react.
Is babel still in the folder.
Also print out the new errors
@RitikaJain8818
from argon-dashboard-react.
babel or babel-jest?
@Henry-Asante
And still showing exactly the same errors as in the screenshot I shared.
from argon-dashboard-react.
@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.
@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.
@collinzo10 Your welcome, all the best!
from argon-dashboard-react.
@Kurosakicoder The problem with that is, it fails to build in production
from argon-dashboard-react.
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.
@Henry-Asante
my website was on netlify and after still adding .env, it does not effect in production
from argon-dashboard-react.
Okay that's great to know, someone else might need it. Thanks for contributing.
from argon-dashboard-react.
Thanks a lot @Henry-Asante! your solution works for me :)
from argon-dashboard-react.
@PhiPhiPhi Most welcome
from argon-dashboard-react.
@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.
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.
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.
@BasharSaleh92 @mrunal-badhe Your welcome
from argon-dashboard-react.
Thank you @Henry-Asante, this was driving me crazy 🤯
from argon-dashboard-react.
@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.
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.
@Henry-Asante Please check the issue and let me know.
issue solved?
from argon-dashboard-react.
Please check the latest version of the product, we don't have any issue like that now.
Regards,
Sajad
from argon-dashboard-react.
check your version of react-scripts
uninstall it and install it back to get the latest version
from argon-dashboard-react.
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)
- Guide for integration with Gatsby HOT 5
- Unable to setup HOT 1
- Sidebar opens when any button is clicked on mobile screen HOT 1
- TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined HOT 1
- [Bug] Template will crash on TypeError HOT 1
- [Bug] Template will crash on TypeError HOT 1
- scss files are coming in production build HOT 1
- [Bug] SCSS files are appearing in the browser even after removing from build HOT 4
- [Bug] The documentation page is not working HOT 1
- [Help Wanted] form filter fields based in select field input HOT 2
- Is there an accordion Component? HOT 1
- Fast Clicks in Sidebar Menu HOT 1
- Hide the component in Sidebar HOT 1
- [Bug] Could not resolve dependency: HOT 2
- [Feature Request] Dropdown in sidebar HOT 1
- [Bug] npm not install HOT 5
- but.. "npm install" HOT 1
- Icons HOT 1
- Updating for react router v6 HOT 1
- [Feature Request] Not able to use react lazy() for code splitting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argon-dashboard-react.