Unable to install latest NodeJS version on Ubuntu 14.04
423
The easiest way to install NodeJS is using the official PPA (which contain the latest version (8.X at the time of this edit).
Open a terminal (Ctrl+Alt+T) and run :
Remove current NodeJS installation
sudo apt-get purge nodejs*
Install
curl
sudo apt-get install curl
Install NodeJS:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs
If you absolutely need 0.12 and not 4.1.1 version, run :
Install NodeJS:
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - sudo apt-get install -y nodejs
Related videos on Youtube
Author by
Samuel
Updated on September 18, 2022Comments
-
Samuel over 1 year
I am using django. In my views I want to know which button was pressed.
My template.html looks like:
{% for post in posts %} <button name="{{ post.pk }}" type="submit">{{ post.title }}</button> {% endfor %}
I know that in my views.py I can check if button x was pressed by just:
if '12345' in request.POST: # do something elif '23456' in request.POST: #do something else
But is there a way to get the primary key without checking every key possible?
I would love something like this:
#PSEUDOCODE post_primary_key = request.POST.get_name()
If my approach is fundamentally bad, I am also open to alternative ways of solving my problem.
-
karel over 8 yearspossible duplicate of Installing the latest Node.js / MongoDB? See user's answer for instructions for installing node.js 0.12..
-
ViLuWi almost 3 yearsYou can make an array and loop through this.
-
-
Edik Mkoyan over 8 yearsThis will not help, see the update in question.
-
hg8 over 8 yearsPlease see my edited answer.
-
gorodezkiy over 8 yearsWorked for me only after I changed distro name of my Ubuntu, which previously was LinuxMint. When I tried to install for the first time, I got error
## Your distribution, identified as "petra", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support
. Fixed by changing distro release info as described here askubuntu.com/questions/115429/… -
Prakhar almost 3 yearsIf you want to send
POST
request, then please specify will make a little changes. Otherwise if you just want to get the pk of the post which was clicked(which is your question title)
, then you are good to go.