I can’t install yarn using the orb “circleci/node@2.1.1” and the command “node/install-yarn” (version 1.22.4)
I get the following logs and error:
Selected version of Yarn is 1.22.4
Checking if YARN is already installed...
Installing YARN v1.22.4
Verifying YARN install
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module '/home/circleci/project/.yarn/releases/yarn-1.22.4.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Something went wrong; the specified version of Yarn could not be installed
Exited with code exit status 1
I am not doing anything fancy, was just trying out orbs…
It’s funny because if I ssh into it I can see yarn being correctly installed as well as the correct “echo” being logged on the terminal if I copy paste the last part of the yarn-install script.
if yarn --version | grep "$YARN_ORB_VERSION" > /dev/null 2>&1; then
echo "Success! Yarn $(yarn --version) has been installed to $(which yarn)"
else
echo "Something went wrong; the specified version of Yarn could not be installed"
exit 1
fi
Can you try it again and let me know if you still get a red build? I think there might have been issues with NPM this week.
Also I see that you’re using our next-gen convenience images! Another option is to use the Node 12.16 image, so you won’t have to install Node and Yarn with build: https://hub.docker.com/r/cimg/node
Also, can you try running your config without the checkout step? This will help us identify if maybe something is up with yarn.lock or if it is an issue with the executor.
Thanks for trying it! OK so now at least we have ruled out the image. Let’s see if there’s an issue with your yarn.lock file by creating a fresh one. Can you delete your yarn.lock file, re-run yarn install locally, and then push that commit up?
Thanks for your guys’ help! I realized I hadn’t checked in some of the files that are needed when using yarn. I believe it’s specifically the .yarn/releases/yarn-1.22.4.js that was needed but as the yarn docs suggested, in order to opt in to their “zero-install” feature, there were also others that needed to be checked in.
Anyway, the last build, this time with the checkout step worked!