Skip to content

Conversation

MikeMcC399
Copy link
Contributor

What's the problem this PR addresses?

The https://yarnpkg.com/cli/dlx#examples instructions fail:

Use create-react-app to create a new React app :

corepack enable yarn
cd $(mktemp -d)
yarn dlx create-react-app ./my-app
$ yarn dlx create-react-app ./my-app
! Corepack is about to download https://repo.yarnpkg.com/4.6.0/packages/yarnpkg-cli/bin/yarn.js
? Do you want to continue? [Y/n]

➤ YN0000: · Yarn 4.6.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + create-react-app@npm:5.1.0, ansi-styles@npm:4.3.0, balanced-match@npm:1.0.2, block-stream@npm:0.0.9, and 60 more.
➤ YN0000: └ Completed in 0s 706ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 64 packages were added to the project (+ 2.97 MiB).
➤ YN0000: └ Completed in 0s 815ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 1s 717ms

create-react-app is deprecated.

You can find a list of up-to-date React frameworks on react.dev
For more info see:https://react.dev/link/cra

This error message will only be shown once per install.
/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:5739
      throw EROFS(`open '${p}'`);
      ^

Error: EROFS: read-only filesystem, open '/node_modules/create-react-app/given-deprecation-warning'
    at makeError$1 (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:769:24)
    at EROFS (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:796:10)
    at ZipFS.prepareWriteFile (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:5739:13)
    at ZipFS.writeFileSync (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:5723:55)
    at /tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:3055:22
    at /tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:3304:66
    at ZipOpenFS.getMountSync (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:3412:14)
    at ZipOpenFS.makeCallSync (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:3304:17)
    at ZipOpenFS.writeFileSync (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:3052:17)
    at VirtualFS.writeFileSync (/tmp/xfs-4a58d078/dlx-14138/.pnp.cjs:2028:24) {
  code: 'EROFS'
}

Node.js v22.15.0

How did you fix it?

In packages/plugin-dlx/sources/commands/dlx.ts replaced use of create-react-app in examples using instead create-vite.

To test, execute the following on Ubuntu 22.04.2 LTS, Node.js 22.15.0 LTS, Corepack 0.32.0:

corepack enable yarn
cd $(mktemp -d)
yarn dlx create-vite

take all defaults and confirm there is no error from Yarn, then execute:

cd vite-project
corepack use yarn@stable
yarn
yarn dev

Open http://localhost:5173 in web browser and confirm that Vite + TypeScript shows.

For documentation:

with yarn/berry and PR branch dlx-example

cd packages/docusaurus
yarn start

View http://localhost:3000/cli/dlx#examples in a browser and check that the text changes are showing correctly.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@MikeMcC399 MikeMcC399 marked this pull request as draft May 10, 2025 18:55
@MikeMcC399

This comment was marked as resolved.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 10, 2025 20:25
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@yarnpkg yarnpkg deleted a comment May 10, 2025
@arcanis arcanis merged commit bee82ef into yarnpkg:master May 10, 2025
26 checks passed
@MikeMcC399 MikeMcC399 deleted the dlx-example branch May 11, 2025 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Docs dlx create-react-app fails with deprecation warning and error EROFS
2 participants