Comments (5)
Hi @mockdeep ! Thanks for submitting this issue. Can you inform us on how often this occurs? I believe this might be an issue with the install script provided by nvm, or with github being flaky on clone connections. While searching around for issues like this, I kept stumbling across posts where people are changing the port from ssh to ssl: https://gist.github.com/kcc0/d88150ace547976cfcccd578f30c816a
However, I think that might be a solution to when the 22 port is blocked by a firewall, which doesn't apply here.
from node-orb.
Hi @Jaryt, thanks for the quick response. We see this issue a handful of times each week. I think it's probably our largest source of flake in our test suite at the moment.
Out of curiosity, I was looking at how asdf installs node and it looks like they use node-build
. I've got no idea how that is different from nvm, but maybe worth looking into?
Also, should the installation be cached so that it doesn't need to be reinstalled each time? I wonder if that might reduce the flake some, too.
from node-orb.
I'd have to investigate the caching of .nvm further to ensure that it's stable. But since you are encountering this, I would encourage you to experiment with caching /home/circleci/.nvm
and letting us know how you fair! (I will experiment with this as well, once I get the chance)
from node-orb.
This is failing pretty hard for us right now. I haven't had a chance to try the caching, yet, but we're seeing a ton of failures with exit status 18. It's hard to tell anything else about why it is failing from the output:
output
#!/bin/bash -eo pipefail
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
# FUNCTIONS
get_yarn_version () {
if [[ "$NODE_PARAM_YARN_VERSION" == "" ]]; then
YARN_ORB_VERSION=$(curl -Ls -o /dev/null -w "%{url_effective}" \
"https://github.com/yarnpkg/yarn/releases/latest" | sed 's:.*/::' | cut -d 'v' -f 2 | cut -d 'v' -f 2)
echo "Latest version of Yarn is $YARN_ORB_VERSION"
else
YARN_ORB_VERSION="$NODE_PARAM_YARN_VERSION"
echo "Selected version of Yarn is $YARN_ORB_VERSION"
fi
}
installation_check () {
echo "Checking if YARN is already installed..."
if command -v yarn > /dev/null 2>&1; then
if yarn --version | grep "$YARN_ORB_VERSION" > /dev/null 2>&1; then
echo "Yarn $YARN_ORB_VERSION is already installed"
exit 0
else
echo "A different version of Yarn is installed ($(yarn --version)); removing it"
if uname -a | grep Darwin > /dev/null 2>&1; then
brew uninstall yarn > /dev/null 2>&1
elif grep Alpine /etc/issue > /dev/null 2>&1; then
apk del yarn > /dev/null 2>&1
elif grep Debian /etc/issue > /dev/null 2>&1; then
$SUDO apt-get remove yarn > /dev/null 2>&1 && \
$SUDO apt-get purge yarn > /dev/null 2>&1
elif grep Ubuntu /etc/issue > /dev/null 2>&1; then
$SUDO apt-get remove yarn > /dev/null 2>&1 && \
$SUDO apt-get purge yarn > /dev/null 2>&1
elif command -v yum > /dev/null 2>&1; then
yum remove yarn > /dev/null 2>&1
fi
$SUDO rm -rf "$HOME/.yarn" > /dev/null 2>&1
$SUDO rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg > /dev/null 2>&1
fi
fi
}
get_yarn_version
installation_check
# install yarn
echo "Installing YARN v$YARN_ORB_VERSION"
curl -L -o yarn.tar.gz --silent "https://yarnpkg.com/downloads/$YARN_ORB_VERSION/yarn-v$YARN_ORB_VERSION.tar.gz"
$SUDO tar -xzf yarn.tar.gz && rm yarn.tar.gz
$SUDO mkdir -p /opt/yarn
$SUDO mv yarn-v"${YARN_ORB_VERSION}"/* /opt/yarn
$SUDO rm -rf "yarn-v${YARN_ORB_VERSION}"
$SUDO chmod 777 "/opt/yarn"
$SUDO ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn
$SUDO ln -s /opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg
$SUDO ln -s /opt/yarn/bin/yarn.js /usr/local/bin/yarn.js
$SUDO mkdir -p ~/.config
if uname -a | grep Darwin; then
$SUDO chown -R "$USER:$GROUP" ~/.config
$SUDO chown -R "$USER:$GROUP" /opt/yarn
else
$SUDO chown -R "$(whoami):$(whoami)" /opt/yarn
$SUDO chown -R "$(whoami):$(whoami)" ~/.config
fi
# test/verify version
echo "Verifying YARN install"
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
Latest version of Yarn is 1.22.17
Checking if YARN is already installed...
A different version of Yarn is installed (1.22.5); removing it
Installing YARN v1.22.17
Exited with code exit status 18
CircleCI received exit code 18
from node-orb.
Moving to backlog as we will be escalating this to our images team.
from node-orb.
Related Issues (20)
- `node/test`: Add support to store code coverage
- Cache dependencies by workflow instead of job HOT 1
- Support pnpm HOT 2
- Change log
- "max-workers" as a parameter or a step to check the size of resource class
- Upgrade Yarn Install Command to Berry HOT 3
- Install Job Fails - Out of sync HOT 1
- Node has issues installing. HOT 1
- Prevent nvm from falling back to building from source HOT 2
- Inability to install requested NodeJS version does not break the build
- May need to be able to pass http session type to the curl commands HOT 1
- Support Bun
- Latest container no longer includes `node-gyp`
- Node fails to download HOT 2
- Change `install-packages` `include-branch-in-cache-key` default to `false` HOT 1
- Caching fails if no lockfile exists HOT 3
- Cache created but ignored by default HOT 2
- install-yarn fails stating sudo command not found
- In yarn-berrry, node_modules are not cached causing the native binaries to be rebuild every time
- install-yarn does not work on machine executors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-orb.