My circle.yml
is set to install the current stable version of node per CircleCI's docs:
machine:
node:
version: 4.2.2
However Circle seems to be ignoring this and using the default pre-stable version of node. Amongst my error messages:
npm ERR! node v0.10.33
npm ERR! npm v2.13.5
How can I make CircleCI use the version of node specified in it's config file?
You can only choose a version that is pre installed in the OS. node 4.2.6 is now the default version for Ubuntu 14.
Ubuntu 14 has: https://circleci.com/docs/build-image-trusty/#nodejs
Ubuntu 12 has: https://circleci.com/docs/build-image-precise/#nodejs
I'm not sure what specifically I fixed, but here's my current working CircleCI config. Note Circle's old Ubuntu needs a newer compiler to run the current stable version of node.
machine:
node:
version: 4.2.2
# From for occasional ELIFECYCLE errors compiling microtime
# https://discuss.circleci.com/t/using-node-js-4-0-on-circleci/26
dependencies:
pre:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update
- sudo apt-get install -y gcc-4.9 g++-4.9
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 10
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 10
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
# Circle uses npm v2 by default
- npm install -g [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With