#7119·vue-cli

Error: The project seems to require yarn but it's not installed.

Author: gyt95Created Apr 28, 2022Updated Nov 5, 2025

Version

5.0.3

Environment info

bash
win 10
node v16.14.2
yarn v1.22.18

Steps to reproduce

At first the repo can run normally through yarn serve

then, I use vue upgrade --next to upgrade [email protected] to [email protected] then, I use yarn serve again but Error

I added console.log in @vue/cli-shared-utils/lib/env.js of node_modules, and found that the internal error was Error: Command failed: yarn --version. But! I can use yarn -v to check my yarn version on my cmd.

And the difference is that there is no throw error in [email protected], while [email protected] exits directly. Why is this happening? It is obvious that the code of yarn is the same.

How can the repo run normally through yarn serve?

dependence "vue": "^2.6.11", "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0",

What is expected?

I hope to use yarn serve to run repo.

What is actually happening?

ERROR Error: The project seems to require yarn but it's not installed.

1651134089(1) 1651134133(1)

this is [email protected] 1651134687(1)

this is [email protected] 1651134785(1)