Skip to content

Contributor Windows build on non-HOMEDRIVE 'Could not resolve "clipanion"' #598

@MikeMcC399

Description

@MikeMcC399

Issue

With a clone of https://github.com/nodejs/corepack on a Windows 11 D: drive corepack yarn build fails with:

✘ [ERROR] Could not resolve "clipanion"

and other similar errors.

I ran into this issue when following up testing on Windows. If it is an expected restriction, then it could be added as a note to the CONTRIBUTING document.

Steps to reproduce

On Windows 11 24H2 with Node.js 22.13.0 LTS:

git clone https://github.com/nodejs/corepack # to drive which is not the Windows `HOMEDRIVE`
cd corepack
corepack yarn install
corepack yarn build

Logs

$ corepack yarn install
corepack yarn build
➤ YN0000: · Yarn 4.6.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 424 packages were added to the project (+ 131.97 MiB).
➤ YN0000: └ Completed in 10s 889ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 11s 136ms
✘ [ERROR] Could not resolve "clipanion"

    sources/main.ts:1:44:
      1 │ import {BaseContext, Builtins, Cli}    from 'clipanion';
        ╵                                             ~~~~~~~~~~~

  You can mark the path "clipanion" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "clipanion"

    sources/commands/deprecated/Prepare.ts:1:42:
      1 │ import {Command, Option, UsageError} from 'clipanion';
        ╵                                           ~~~~~~~~~~~

  You can mark the path "clipanion" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@zkochan/cmd-shim"

    sources/commands/Enable.ts:1:78:
      1 │ import cmdShim                                                           from '@zkochan/cmd-shim';
        ╵                                                                               ~~~~~~~~~~~~~~~~~~~

  You can mark the path "@zkochan/cmd-shim" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "clipanion"

    sources/commands/Enable.ts:2:78:
      2 │ import {Command, Option, UsageError}                                     from 'clipanion';
        ╵                                                                               ~~~~~~~~~~~

  You can mark the path "clipanion" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "clipanion"

    sources/commands/InstallLocal.ts:1:34:
      1 │ import {Command, UsageError} from 'clipanion';
        ╵                                   ~~~~~~~~~~~

  You can mark the path "clipanion" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "clipanion"

    sources/commands/Pack.ts:1:42:
      1 │ import {Command, Option, UsageError} from 'clipanion';
        ╵                                           ~~~~~~~~~~~

  You can mark the path "clipanion" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

6 of 46 errors shown (disable the message limit with --log-limit=0)
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: D:\github2\corepack-on-d\.yarn\unplugged\@esbuild-win32-x64-npm-0.21.5-eddc2b5ad6\node_modules\@esbuild\win32-x64\esbuild.exe ./sources/_lib.ts --bundle --platform=node --target=node18.17.0 --external:corepack --outfile=./dist/lib/corepack.cjs --resolve-extensions=.ts,.mjs,.js
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:882:11)
    at Object.execFileSync (node:child_process:918:15)
    at Object.<anonymous> (D:\github2\corepack-on-d\.yarn\unplugged\esbuild-npm-0.21.5-d85dfbc965\node_modules\esbuild\bin\esbuild:219:28)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Object..js (node:internal/modules/cjs/loader:1699:10)
    at Module.load (node:internal/modules/cjs/loader:1313:32)
    at Function.<anonymous> (node:internal/modules/cjs/loader:1123:12)
    at require$$0.Module._load (D:\github2\corepack-on-d\.pnp.cjs:10784:31) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 23916,
  stdout: null,
  stderr: null
}

Node.js v22.13.0

Workarounds

Disable Yarn Global Cache

Use enableGlobalCache to disable Yarn Global Cache:

In Git Bash:

export YARN_ENABLE_GLOBAL_CACHE=false
corepack yarn install
corepack yarn build

Move to HOMEDRIVE

Move cloned repo to Windows HOMEDRIVE, which is usually C:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions