Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve "ENOTDIR: not a directory node_modules/.DS_Store/package.json" error when running yarn build #29927

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

subtleGradient
Copy link
Contributor

TL;DR -- Solve "ENOTDIR: not a directory node_modules/.DS_Store/package.json" error when running yarn build

Summary

Fixed an edge case bug in scripts/rollup/build-all-release-channels.js that caused the build to fail when a .DS_Store file was present in the node_modules directory.

Motivation

  1. Wanted to run the build
  2. Got an error when I tried to run the build
  const stats = binding.stat(
                        ^

Error: ENOTDIR: not a directory, stat '/var/folders/nk/76thgdjx2yz9dhwzwyx0kd440000gn/T/tmp-43728C5YoTppMWD6f/node_modules/.DS_Store/package.json'
    at Object.statSync (node:fs:1659:25)
    at updatePackageVersions (/Users/tom/Projects/react/scripts/rollup/build-all-release-channels.js:340:22)

How I tested this change

BEFORE: Verify problem exists

  1. Add a .DS_Store file to the node_modules directory
  2. yarn build
  3. Build fails

AFTER: Verify problem is fixed

  1. Add a .DS_Store file to the node_modules directory
  2. yarn build
  3. Build succeeds

Copy link

vercel bot commented Jun 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 6:42pm

@react-sizebot
Copy link

react-sizebot commented Jun 18, 2024

Comparing: 133ada7...a0cc3e5

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 497.93 kB 497.93 kB = 89.26 kB 89.26 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 502.75 kB 502.75 kB = 89.96 kB 89.96 kB
facebook-www/ReactDOM-prod.classic.js = 597.10 kB 597.10 kB = 105.31 kB 105.31 kB
facebook-www/ReactDOM-prod.modern.js = 571.44 kB 571.44 kB = 101.24 kB 101.24 kB
test_utils/ReactAllWarnings.js Deleted 62.88 kB 0.00 kB Deleted 15.69 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 62.88 kB 0.00 kB Deleted 15.69 kB 0.00 kB

Generated by 🚫 dangerJS against a0cc3e5

Solves ENOTDIR: not a directory `node_modules/.DS_Store/package.json`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants