How to set the yarn > 4.x #3135
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?React Native Steps to reproducescripts: Expected resultsThe environment use yarn > 4 Actual results#!/usr/bin/env bash yarn set version stable Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19. Build failed :| Build id (optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @unbegrenzt, to use a specific version of Yarn, just uninstall the preinstalled version and install the one you need using npm.
|
Beta Was this translation helpful? Give feedback.
-
I am not sure why the answer above is marked as correct, it doesn't work. There is no [email protected] in NPM. npm install -g [email protected]
npm error code ETARGET
npm error notarget No matching version found for [email protected].
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist. You can check the existing yarn versions in npm with For me, what ended up working was deleting any existing yarn instances and then re-installing # remove any instances of yarn so it doesn't conflict with corepack
rm -rf /opt/homebrew/bin/yarn # macos machines
rm -rf ~/.yarnrc.yml # linux machines
corepack enable
corepack prepare [email protected] --activate
YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install |
Beta Was this translation helpful? Give feedback.
Hello @unbegrenzt, to use a specific version of Yarn, just uninstall the preinstalled version and install the one you need using npm.