Skip to content

Usage Error when running yarn global add $PWD with yarn 2+ #1

@todrobbins

Description

@todrobbins

I get the following error when running the yarn global add $PWD command:

graph-validator git:(main) ✗ yarn global add $PWD
Usage Error: The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead

So I tried yarn dlx add $PWD just in case and got this output:

➜  graph-validator git:(main) ✗ yarn dlx add $PWD
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ add@npm:2.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done in 0s 388ms

Internal Error: Binary not found (add) for root-workspace-0b6124@workspace:.
    at z9 (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:423:1838)
    at Object.VDe (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:423:2354)
    at /Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:601:306
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ar.mktempPromise (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:314:68744)
    at async Rm.execute (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:597:49122)
    at async Rm.validateAndExecute (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:345:673)
    at async Bs.run (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:359:2087)
    at async Bs.runExit (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:359:2271)
    at async i (/Users/trobbins/.cache/node/corepack/yarn/3.2.3/yarn.js:446:12696)

Specs:

  • node v19.0.0
  • yarn v3.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions