-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown option: base.configFile error when running tests #5259
Comments
I had the same issue, and I'm using the same I was able to get rid of this error by deleting package-lock and reinstalling. |
I'm not able to repo this. Can you provide a small isolated example please? |
Please post your |
I do have
|
I was also able to fix this issue by deleting package-lock.json and node_modules folder and running |
Sounds like an npm issue then. Use the workaround above if you bump into this. |
I was repeatedly having this problem yesterday, even with the above workaround. I added the dependencies one by one back today and was able to add them back all in without incident, so who knows what npm was having trouble with. |
I am having the same issue. Cleaning node_modules and installing again did not fix it.
|
@gustavobini what about deleting both package-lock and node_modules and installing again? |
Sorry, I meant to say I did both those things. |
Nothing new to bring to the table, but I'm having the same issue. |
I’m just assuming that If you have installed any package that required babel related packages then it could cause some issues with the new Babel 7. In my case I suspect storybook which required babel-core and babel-runtime alongside it. I removed storybook and any babel related packages before removing package-lock and node_modules. I don’t know if this fixed the issue but worth looking at. |
npm view babel-core |
Can someone please install Yarn, use Yarn instead of npm, and see if that fixes the problem? |
I believe the appropriate command would be
|
Right :-D +-- [email protected] |
/cc @gaearon it looks like there's some complex trickery going on here, shouldn't our package tree check be catching the wrong babel-core version? |
@arnvol FYI, here is my version of package tree of working project.
|
|
I was having the In the end this solution from @davidlukerice worked for me.:
As a last resort I cloned |
Has anyone raised an issue with NPM at all? I would rather not switch package managers and my workflow just because of this issue. I would expect to have found more issues regarding this elsewhere but this is the only one I've found. If it's a problem with Jest perhaps we should also open an issue with Jest? |
@JeffBaumgardt I'm not sure I follow how this is a problem with Jest. The install works perfectly fine when using Yarn, and in some cases when you get npm to behave in certain ways. This issue definitely lies on npm's side. |
@bugzpodder you probably did this but just to be sure; did you run all tests or just npm test. If I don’t run all, it doesn’t happen because it doesn’t run any tests of course. Just making sure that’s not it |
Actually, i was able to get a repo using your steps. |
Currently I have 4 clones running npm, two of them has the initial error, two of them works successfully =/ Haven't been able to reproduce with yarn. |
Hi, @JaccoGoris I cloned your repo and got the same config error. I had the same issue with my repo and I found that the issue could be from babel-core still using 6.26.3 for some packages so I compared the dependency tree of both my project and yours.
My project:
Your project:
I found that on my project, [email protected] is on the top level of the dependency tree, above any other subtrees that uses babel 6.26.3. So I did following and npm test worked like a charm.
And the dependency tree of babel-core should look like following when you run
Hope this helps. Edit: seems like explicitly installing
|
I ran into this issue following those exact steps while porting our previuosly ejected app to cra2. However I managed to get it work by running It also works on other computers because presumably package-lock.json has preserved the right structure. |
@jambyung following your step did work, so there must indeed be a tree issue somewhere. without jest-junit the tests ran fine, both in the repo project and my own actual project! so you are very likely on the right path here. |
@JaccoGoris Good to hear that! I also found that explicitly installing the bridge package with So I think there are 2 methods that you can try to fix this issue.
I recommend running |
@jambyung thanks a lot! 2. method worked. |
@jambyung you might want to add: |
@JaccoGoris in my case the second method works along with jest-junit. |
@arnvol Oh yeah I know but in my case, I figured out I could go without jest-junit and it was much easier to just remove it than to add the babel bridge :) |
@jambyung thanks |
Weird, definitely a package installation issue. I'd expect
or
but instead you've ended up with
so that |
@loganfsmyth I have the exact same tree in two different repos and they gave the different results. What am I missing?
|
@bugzpodder It is the relative placement of |
Looks like I am actually having some caching issues. |
This works for me! Using [email protected] |
If you delete |
I had the same issue, using "react-scripts": "^1.1.5" solved the problem. |
I realized that my react-scripts-ts was in a diferenf version from react-scripts, then I just remove. |
For some unknown reason deleting node_modules and package-lock.json and even resetting my project repository to original state didn't work. I tried it about hundred times in a day, reinstalled npm and so on, but still no success... Then I just renamed the project folder to something else (with cleared node_modules and package-lock.json), run I've also created new create-react-app somewhere else in the filesystem during the same time, so not sure if that had any effect... but just in case |
When i updated my react-scripts from 1.1.15 to 2.1.1 i had the same issue. I solved it by deleting the |
I was getting this error and was able to fix it by doing |
I had to replace |
|
Note from Maintainers
This is reportedly an issue with npm, as you will find below.
Please install Yarn as it's reportedly correctly hoisting packages, preventing this error.
If you'd like to continue using
npm
, runnpm ls babel-core
and remove offending packages that are relying on 6.x. Additionally, file a bug report with npm.Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
npm --version
6.4.1
Which terms did you search for in User Guide?
jest, test, babel, Unknown option: base.configFile
Environment
Environment:
OS: macOS 10.14
Node: 8.10.0
Yarn: 1.6.0
npm: 6.4.1
Watchman: 4.9.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.4.2 => 16.5.2
react-dom: ^16.4.2 => 16.5.2
react-scripts: 2.0.3 => 2.0.3
Steps to Reproduce
npm start
)npm test
followed bya
Expected Behavior
Tests should run and complete
Actual Behavior
I get the following error on every test
my
setupTests.js
file contains the followingAdding them to a fresh app doesn't cause an issue.
Reproducible Demo
This is an internal project, but I'll work to see if I can narrow it down at all and reproduce in a fresh install. So far I haven't figured it out.
I'm putting this issue up in the meantime to see if anyone else runs into it while migrating to v2. It also popped up at #5103 (comment), but clearing the node modules / lock / &c didn't help, nor did upgrading to node v10.
The text was updated successfully, but these errors were encountered: