NPM run build Error: [BABEL] No “exports” main defined in

According to guesses, it should be a project created under a low version of nodejs. In a high version of nodejs, compilation problems caused by version differences

Solution

Modify the configuration of exports in node_modules\@babel\helper-compilation-targets\package.json as follows:

{
   ...,
   "exports": {
    ".":"./lib/index.js"
   }
}

Similar Posts: