standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

"MODULE_NOT_FOUND" when using Yarn 2 + global cache #871

Closed jonaskuske closed 3 years ago

jonaskuske commented 4 years ago

When using Yarn 2 and enableGlobalCache: true in .yarnrc.yml, all imports will result in errors.

Repro here: https://github.com/jonaskuske/esm-yarn2-global-repro

With server.js as

import express from 'express';

started via node -r esm server.js in the npm/yarn script, it throws this error:

image

jonaskuske commented 3 years ago

Fixed in https://github.com/yarnpkg/berry/pull/2068