Skip to content

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

Open
@gyt95

Description

@gyt95

Version

5.0.3

Environment info

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 vue-cli@4.5.3 to vue-cli@5.0.3
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 vue-cli@4.5.3, while vue-cli@5.0.3 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 vue-cli@5.0.3
1651134687(1)

this is vue-cli@4.5.x
1651134785(1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions