Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: If yarn v4 runs scripts with yarn self, it will fallback to 1.22.22 #6674

Closed
1 task
asika32764 opened this issue Feb 2, 2025 · 1 comment
Closed
1 task
Labels
bug Something isn't working

Comments

@asika32764
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

The package.json file:

{
  "name": "app",
  "private": true,
  "type": "module",
  "scripts": {
    ...
    "deploy": "git pull && yarn install && yarn build-only"
  },
  ...
  "packageManager": "[email protected]"
}

When running yarn install, it correctly shows 4.6.0

$ yarn install

➤ · Yarn 4.6.0
➤ ┌ Resolution step
➤ └ Completed
...

But if I run yarn deploy, it shows 1.2.22 when running the yarn install sub command:

$ yarn deploy

Already up to date.
yarn install v1.22.22
[1/4] 🔍  Resolving packages...

I can make sure I didn't install yarn 1.2.22 before, see npm list:

$ npm list -g
/.../.nvm/versions/node/v22.13.1/lib
├── @ionic/[email protected]
├── [email protected]
└── [email protected]

To reproduce

As the description.

Environment

System:
    OS: macOS 14.3.1
    CPU: (12) arm64 Apple M3 Pro
  Binaries:
    Node: 22.13.1 - /private/var/folders/sj/yrz5w0ys3cxf73d50l60v39w0000gn/T/xfs-c80f26e4/node
    Yarn: 4.6.0 - /private/var/folders/sj/yrz5w0ys3cxf73d50l60v39w0000gn/T/xfs-c80f26e4/yarn
    npm: 11.1.0 - /Applications/ServBay/script/alias/npm

----

  System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (1) x64 AMD EPYC 7713 64-Core Processor
  Binaries:
    Node: 20.17.0 - /tmp/xfs-a72f763d/node
    Yarn: 4.6.0 - /tmp/xfs-a72f763d/yarn
    npm: 10.8.2 - /usr/bin/npm

Additional context

No response

@asika32764 asika32764 added the bug Something isn't working label Feb 2, 2025
@asika32764 asika32764 changed the title [Bug?]: Yarn v4 run scripts with yarn self, will fallback to 1.2.22 [Bug?]: If yarn v4 runs scripts with yarn self, it will fallback to 1.2.22 Feb 2, 2025
@asika32764 asika32764 changed the title [Bug?]: If yarn v4 runs scripts with yarn self, it will fallback to 1.2.22 [Bug?]: If yarn v4 runs scripts with yarn self, it will fallback to 1.22.22 Feb 2, 2025
@asika32764
Copy link
Author

The reason is that I was added yarn as dependencies, it works correctly after I remove it.

Image

Close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant