`yarn create koishi` 偶遇报错:`No candidates found` 解决案例分享

虽然已经有类似案例了 → yarn create koishi时报错“@intlify/message-compiler@npm:9.12.0: No candidates found”

但是今天群友又遇到了(现在)

2025-01-25T16:00:00Z – 14:00

问题已经解决了,所以在这分享一下过程



执行 yarn create koishi 的时候遇到奇奇怪怪的依赖

@parcel/watcher-darwin-arm64@npm:2.5.1: No candidates found

怎么会有 watcher-darwin-arm64 。。。?

Microsoft Windows [版本 10.0.19045.4717]
(c) Microsoft Corporation。保留所有权利。

D:\QQbots\QQ_bots\koishing\coding\koishi-b>yarn create koishi
yarn create v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-koishi@6.3.2" with binaries:
      - create-koishi
[##########################] 26/26
  Create Koishi  v6.3.2

√ Project name: ... koishi-app
  Scaffolding project in koishi-app ...
  Done.

√ Install and start it now? ... yes
➤ YN0000: · Yarn 4.5.3
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @parcel/watcher-darwin-arm64@npm:2.5.1: No candidates found
➤ YN0000: └ Completed in 0s 818ms
➤ YN0000: · Failed with errors in 0s 830ms
Error: Command failed: yarn install
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at install (C:\Users\shangxue\AppData\Local\Yarn\Data\global\node_modules\create-koishi\lib\index.js:172:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async start (C:\Users\shangxue\AppData\Local\Yarn\Data\global\node_modules\create-koishi\lib\index.js:196:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 20708,
  stdout: null,
  stderr: null
}
Done in 4.54s.

D:\QQbots\QQ_bots\koishing\coding\koishi-b>

解决方法:

cd koishi-app

先使用

yarn config set npmRegistryServer https://registry.npmjs.org/

切换到官方源


然后执行

yarn 

问题解决后再切回去

yarn config set npmRegistryServer https://registry.npmmirror.com/

完整日志

Microsoft Windows [版本 10.0.19045.4717]
(c) Microsoft Corporation。保留所有权利。

D:\QQbots\QQ_bots\koishing\coding\koishi-b>yarn create koishi
yarn create v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-koishi@6.3.2" with binaries:
      - create-koishi
[##########################] 26/26
  Create Koishi  v6.3.2

√ Project name: ... koishi-app
  Scaffolding project in koishi-app ...
  Done.

√ Install and start it now? ... yes
➤ YN0000: · Yarn 4.5.3
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @parcel/watcher-darwin-arm64@npm:2.5.1: No candidates found
➤ YN0000: └ Completed in 0s 818ms
➤ YN0000: · Failed with errors in 0s 830ms
Error: Command failed: yarn install
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at install (C:\Users\shangxue\AppData\Local\Yarn\Data\global\node_modules\create-koishi\lib\index.js:172:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async start (C:\Users\shangxue\AppData\Local\Yarn\Data\global\node_modules\create-koishi\lib\index.js:196:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 20708,
  stdout: null,
  stderr: null
}
Done in 4.54s.

D:\QQbots\QQ_bots\koishing\coding\koishi-b>cd koishi-app

D:\QQbots\QQ_bots\koishing\coding\koishi-b\koishi-app>yarn config set npmRegistryServer https://registry.npmjs.org/
➤ YN0000: Successfully set npmRegistryServer to 'https://registry.npmjs.org/'

D:\QQbots\QQ_bots\koishing\coding\koishi-b\koishi-app>yarn
➤ YN0000: · Yarn 4.5.3
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @koishijs/client@npm:5.30.2, @koishijs/plugin-actions@npm:0.0.2, and 701 more.
➤ YN0000: └ Completed in 11s 217ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ koishi-app@workspace:. doesn't provide @koishijs/loader (p9ebae), requested by @koishijs/plugin-config and other dependencies.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 380ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.23.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➤ YN0007: │ vue-demi@npm:0.14.10 [d866f] must be built because it never has been before or the last one failed
➤ YN0007: │ @parcel/watcher@npm:2.5.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.24.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 4s 688ms
➤ YN0000: · Done with warnings in 16s 363ms

D:\QQbots\QQ_bots\koishing\coding\koishi-b\koishi-app>yarn config set npmRegistryServer https://registry.npmmirror.com/
➤ YN0000: Successfully set npmRegistryServer to 'https://registry.npmmirror.com/'

D:\QQbots\QQ_bots\koishing\coding\koishi-b\koishi-app>yarn
➤ YN0000: · Yarn 4.5.3
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ koishi-app@workspace:. doesn't provide @koishijs/loader (p9ebae), requested by @koishijs/plugin-config and other dependencies.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 390ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 717ms

D:\QQbots\QQ_bots\koishing\coding\koishi-b\koishi-app>
1 个赞

我们可以前往镜像站进行同步,然后等待几分钟。

image

1 个赞