+
Skip to content

Yarn PnP cache folder resolution failed on Windows #3131

@demigor

Description

@demigor

Hi,
I'm trying to active PnP mode for Yarn, but Esbuild (0.17.19) fails to resolve node modules. Windows OS.
Here is the log snippet, demonstrating the issue:

Checking for package alias matches
    Failed to find any package alias matches
  Read 5 entries for directory "D:\\nitro.debug\\Nitro.Web.App\\src\\blocks\\benchmarks"
  No "browser" map found in directory "D:\\nitro.debug\\Nitro.Web.App\\src\\blocks\\benchmarks"
  Searching for "react/jsx-runtime" in "node_modules" directories starting from "D:\\nitro.debug\\Nitro.Web.App\\src\\blocks\\benchmarks"
    Using Yarn PnP manifest from "D:\\nitro.debug\\Nitro.Web.App\\.pnp.cjs"
      Resolving "react/jsx-runtime" in "D:\\nitro.debug\\Nitro.Web.App\\src\\blocks\\benchmarks"
      Parsed bare identifier "react" and module path "/jsx-runtime"
      Found parent locator: ["nitro.app", "workspace:."]
      Found parent package at "./"
      Found dependency locator: ["react", "npm:18.1.0"]
      Found package "react" at "../../../C:/Users/lavni/AppData/Local/Yarn/Berry/cache/react-npm-18.1.0-d66a868dc8-8.zip/node_modules/react/"
      Resolved "react/jsx-runtime" via Yarn PnP to "D:\\C:\\Users\\lavni\\AppData\\Local\\Yarn\\Berry\\cache\\react-npm-18.1.0-d66a868dc8-8.zip\\node_modules\\react" with subpath "/jsx-runtime"
    Failed to read directory "D:\\C:\\Users\\lavni\\AppData\\Local\\Yarn\\Berry\\cache\\react-npm-18.1.0-d66a868dc8-8.zip\\node_modules\\react"
    Failed to resolve "D:\\C:\\Users\\lavni\\AppData\\Local\\Yarn\\Berry\\cache\\react-npm-18.1.0-d66a868dc8-8.zip\\node_modules\\react\\jsx-runtime" to a file

Last two lines show, that Esbuild failed to properly calculate the Yarn cache path (Failed to resolve "D:\C:\)
If I move Yarn cache to drive D:, error looks similar Failed to resolve "D:\D:\

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载