@jsenv/core 41.4.13 → 41.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,9 +154,15 @@ export const createNodeEsmResolver = ({
154
154
  }
155
155
  }
156
156
  version_relationship: {
157
- const packageVersion = packageDirectory.read(
157
+ const closestPackageJson = packageDirectory.read(
158
158
  closestPackageDirectoryUrl,
159
- ).version;
159
+ );
160
+ if (!closestPackageJson) {
161
+ // package.json can be momentarily missing while a package manager
162
+ // is installing/updating that package (npm install running in watch mode)
163
+ break version_relationship;
164
+ }
165
+ const packageVersion = closestPackageJson.version;
160
166
  if (!packageVersion) {
161
167
  // package version can be null, see https://github.com/babel/babel/blob/2ce56e832c2dd7a7ed92c89028ba929f874c2f5c/packages/babel-runtime/helpers/esm/package.json#L2
162
168
  break version_relationship;