Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /app/node_modules/@babel/helper-compilation-targets/package.json Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /app/node_modules/@babel/helper-compilation-targets/package.json docker docker

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /app/node_modules/@babel/helper-compilation-targets/package.json


I had the similar problem. npm install @babel/helper-compilation-targets --save-dev solved this situation


Using npm update fixed the same error for me.


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.

  1. Removing the lock file. In this case I'm using yarn so I need to delete the yarn.lock file. If you're using npm the lock file is package-lock.json.
# for yarn userrm yarn.lock# for npm userrm package-lock.json
  1. And then I reinstall all the dependencies.
# for yarn useryarn install# for npm usernpm install