Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /app/node_modules/@babel/helper-compilation-targets/package.json
I was experiencing this issue and I resolved it by removing the lock file and then reinstall everything again.
This is probably not a good solution for everyone but it works for me.
Here's exactly what I have done.
- Removing the lock file. In this case I'm using
yarn
so I need to delete theyarn.lock
file. If you're usingnpm
the lock file ispackage-lock.json
.
# for yarn userrm yarn.lock# for npm userrm package-lock.json
- And then I reinstall all the dependencies.
# for yarn useryarn install# for npm usernpm install