google / zx

A tool for writing better scripts

Home Page:https://google.github.io/zx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yarn3.1.1 cannot run zx

chenyulun opened this issue · comments

Expected Behavior

Actual Behavior

➜  testyarn3 git:(master) ✗ node -v
v16.14.0
➜  testyarn3 git:(master) ✗ yarn -v
3.1.1
➜  testyarn3 git:(master) ✗ corepack enable
➜  testyarn3 git:(master) ✗ yarn zx -v
(node:51581) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/chenyulun390/learn/testyarn3/.pnp.cjs:9971
  return Object.defineProperties(new Error(message), {
                                 ^

Error: chalk tried to access #ansi-styles, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: #ansi-styles (via "#ansi-styles/package.json")
Required by: chalk@npm:5.0.0 (via /Users/chenyulun390/learn/testyarn3/.yarn/cache/chalk-npm-5.0.0-7be183234e-6eba7c518b.zip/node_modules/chalk/source/index.js)

    at internalTools_makeError (/Users/chenyulun390/learn/testyarn3/.pnp.cjs:9971:34)
    at resolveToUnqualified (/Users/chenyulun390/learn/testyarn3/.pnp.cjs:11269:21)
    at Object.resolveToUnqualified (/Users/chenyulun390/learn/testyarn3/.pnp.cjs:11466:26)
    at resolve$1 (file:///Users/chenyulun390/learn/testyarn3/.pnp.loader.mjs:195:31)
    at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
    at link (node:internal/modules/esm/module_job:78:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
➜  testyarn3 git:(master) ✗

Steps to Reproduce the Problem

  1. install node16.14.0
  2. corepack enable
  3. yarn init -2
  4. yarn add zx -D
  5. yarn zx -v

Specifications

  • Version:
  • Platform:

add .yarnrc.yml

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.1.1.cjs

But I want to switch to Plug'n'Play
what should I do?