Skip to content

Unable to create React App with node 20 and yarn 4 #234

@dmelo

Description

@dmelo

Description

The yarn create command is not working with node v20.11.1 and yarn 4.1.1

Steps to reproduce

Steps to reproduce the behavior:

run yarn create react-app --template cra-template-rb frontend

the output is:

❯ yarn create react-app --template cra-template-rb frontend
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + create-react-app@npm:5.0.1, ansi-styles@npm:4.3.0, balanced-match@npm:1.0.2, block-stream@npm:0.0.9, brace-expansion@npm:1.1.11, buffer-from@npm:0.1.2, builtins@npm:1.0.3, chalk@npm:4.1.2, color-convert@npm:2.0.1, color-name@npm:1.1.4, commander@npm:4.1.1, concat-map@npm:0.0.1, core-util-is@npm:1.0.3, cross-spawn@npm:7.0.3, debug@npm:2.6.9, duplexer2@npm:0.0.2, envinfo@npm:7.11.1, fs-extra@npm:10.1.0, fs.realpath@npm:1.0.0, and 47 more.
➤ YN0000: └ Completed in 0s 356ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 66 packages were added to the project (+ 3.01 MiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 486ms


Creating a new React app in /home/dmelo/proj3/alogviewer/frontend.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-rb...

➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + cra-template-rb@npm:1.2.6, react-dom@npm:18.2.0, react-scripts@npm:5.0.1, react@npm:18.2.0, @aashutoshrathi/word-wrap@npm:1.2.6, @alloc/quick-lru@npm:5.2.0, @ampproject/remapping@npm:2.3.0, @apideck/better-ajv-errors@npm:0.3.6, @babel/code-frame@npm:7.24.2, @babel/compat-data@npm:7.24.1, @babel/core@npm:7.24.3, @babel/eslint-parser@npm:7.24.1, @babel/generator@npm:7.24.1, @babel/helper-annotate-as-pure@npm:7.22.5, and 1315 more.
➤ YN0000: └ Completed in 7s 723ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 515ms
➤ YN0000: ┌ Link step
➤ YN0007: │ styled-components@npm:5.3.5 [2da10] must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.36.1 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.36.1 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 4s 827ms
➤ YN0000: · Done in 13s 266ms
/tmp/xfs-5f3b6230/dlx-2660218/.pnp.cjs:6228
    throw firstError;
    ^

Error: The locator that owns the "/home/dmelo/proj3/alogviewer/frontend/node_modules/react-scripts/scripts/init.js" path can't be found inside the dependency tree (this is probably an internal error)
Require stack:
- /home/dmelo/proj3/alogviewer/frontend/[eval]
    at require$$0.Module._resolveFilename (/tmp/xfs-5f3b6230/dlx-2660218/.pnp.cjs:6227:13)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at require$$0.Module._load (/tmp/xfs-5f3b6230/dlx-2660218/.pnp.cjs:6118:31)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at [eval]:2:22
    at runScriptInThisContext (node:internal/vm:144:10)
    at node:internal/process/execution:109:14
    at [eval]-wrapper:6:24
    at runScript (node:internal/process/execution:92:62)

Node.js v20.11.1

Aborting installation.
  node  has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Done.
❯ echo $?
1

Expected behavior
Expected to see the new project on frontend directory

Versions

  • Node/NPM: v20.11.1
  • Yarn: 4.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions