anxs / nodejs Goto Github PK
View Code? Open in Web Editor NEWAnsible role for nodejs
License: MIT License
Ansible role for nodejs
License: MIT License
Should check if node binary exists, is on PATH and it's version is equal or greater than nodejs_version
when installing from source. If so, nothing should be done.
The easiest and cleanest way to do this probably is checking the above conditions in the tasks/main.yml
, register it in a variable and pass it to the when
of the include
statement for the tasks/source.yml
file.
Changing variable nodejs_version
will not update nodejs
to a new version (for package install).
I think solution is to change package name for apt task:
package: "nodejs={{ nodejs_version }}*"
Hi ANXS,
Thank you for all of the ansible roles.
Thought I'd let you know that ansible-galaxy roles have to be manually re-imported per the following Google Groups thread.
The following role is the role I noticed the issue. Specifically for the "Add the node.js binary to the system path" task is different when installing via ansible-galaxy install and looking at the github source.
It looks like the PPA should probably be changed from Chris Lea's to NodeSource's, as per his own blog post: https://chrislea.com/2014/07/09/joining-forces-nodesource/
Install from source doesnt seem to be working on ubuntu:
TASK: [ANXS.nodejs | node.js | source | Build node.js from source] ************
failed: [aws1] => {"changed": true, "cmd": "cd /tmp/node-v0.12.0 && ./configure --prefix=/usr/local/nodejs/node-v0.12.0 && make -j 1 && sudo make install", "delta": "0:00:00.001327", "end": "2015-03-06 21:23:25.054479", "rc": 2, "start": "2015-03-06 21:23:25.053152", "warnings": []}
stderr: /bin/sh: 1: cd: can't cd to /tmp/node-v0.12.0
I checked my temp folder, and cd dir created is node-v0.12.0-linux-x64, I guess the path is incomplete ?
Your dependency check is still looking for your old role name.
dependencies:
- role: Ansibles.build-essential
should be
dependencies:
- role: ANXS.build-essential
it's possible this is just the way it works but for example I set nodejs_version
to 4.4.4
and when it's done
# node --version
v4.4.4
# npm --version
2.15.1
which is pretty far out of date. npm is at 3.9.2. Several packages that work on 4.4.4
won't install correctly without newer versions of npm
. Have you thought about adding an option to install a specific version of npm
?
We see the following message when we provision an Ubuntu 14.04 LTS with nodejs for
NuCivic/ansible-dev-vm#26
TASK: [ANXS.nodejs | node.js | Check if the node version is already installed] ***
failed: [nucvicdev] => {"changed": true, "cmd": "node --version", "failed": true, "rc": 2}
msg: [Errno 2] No such file or directory
...ignoring
I think this may be causing an issue where we are forced to run vagrant provision twice the first time we provision a machine with nodejs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.