Babel installs causing trouble with build/test

I started a new vue application. I followed the steps to configure it for testing with juest. It seems when I load all the dependencies for testing, the build no longer works. I got this message when I ran npm run build:
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
C:\Users\joshr\ontime\src\router\index.js: Cannot read property ‘bindings’ of null

If I uninstall the dependencies, build works, but testing fails (babel-core, babel-preset-env). How can I get both? If I try to install using @babel/core, testing fails as well, it says it needs babel-core