I installed node on my Ubuntu 14.04 machine with:
apt-get install node
However, when I run
node -v
there is no output.
I then tried apt-get install nodejs
, and when I run nodejs -v
I get v0.10.25
.
I'm not really sure what I'm doing wrong to get node working.
My PHP script requires node.js and my check keeps failing:
if(preg_match("/^v\d+.\d+.\d+$/", `node -v`) === 0){
exit_json([
"error" => "Node isn't installed on this machine."
]);
}
How can I correctly install node.js on 14.04? I used digital ocean's tutorial.