FeaturesWP CloudPricingEE CLIContactMy Account
Features
Team Access & User Permissions
Install
Resources
Community
CLEAR
Tutorials
node.js
Latest node.js & npm installation on Ubuntu 12.04
Topics
On this page
-
- Getting Started
- Git and File-System Layout (non-default setup)
- Version Constraints
- Managing Themes and Plugins (for entire WordPress site)
- Updating Themes and Plugins (for entire WordPress site)
- Adding Composer Support to Your Own Themes and Plugins (for developers)
- Using Composer to Manage Own Theme/Plugin Dependencies (for developers)
-
- Assigning Multiple IP Addresses to Single LAN Card
- Disable IPv6 on Ubuntu 12.04
- dsh – distributed shell
- fdupes – find & replace duplicate files with hardlinks
- GPG Keys Cheatsheet
- Increase "Open Files Limit"
- kill all php, nginx, mysql or any kind of processes
- Passwordless Authentication for SSH
- Screen
- search replace in multiple files useing grep xargs sed
- Setup sftp
- sysctl.conf
- Timezone Sync
- Using Google Public DNS on Ubuntu Server
- Using openssl to match private key, cerificate and CSR
- Configure Postfix to Use Gmail SMTP on Ubuntu
- Logrotate Example for Custom Logs
- PHP 5.5, MySQL, Postfix, Nginx and WordPress on Ubuntu
- Serverdensity
- Upgrade Ubuntu 10.04 to 12.04
- Using find and sed to replace strings in multiple files
- Webmin
-
- .my.cnf – mysql user & password
- Analyse slow-query-log using Anemometer
- Improving MySQL Query Cache
- MySQL Query Profiling
- Reset MySQL root password
- tuning-primer.sh – an alternative for mysqltuner
- Using MariaDB 10
- Install/Upgrade to MySQL 5.6 on Ubuntu 12.04 LTS
- Change WordPress Domain Name
- Character Sets and Collations
- Enable innodb_file_per_table
- Enable Remote Access (Grant)
- Installing Percona Toolkit
- Using tmpfs for temporary folder creation
- YARPP and InnoDB
- Convert MyISAM to InnoDB
- Using tmpfs for mysqldump & mysqlimport
- Convert from INNODB to MYISAM
- Analyse slow-query-log using mysqldumpslow & pt-query-digest
- mysqlcheck with cron to optimize automatically
- Using MySQLTuner to Optimize MySQL configuration
-
-
- Directly connect to PHP-FPM
- Generating core-dump for php5-fpm
- GeoIP
- Having php5 and php7 on same system.
- Install Xdebug and configure it with webgrind
- Installation of PHP Code Review Tools
- memcache
- PHP's Zend Opcache Config & Web Viewer
- Setting Sqlite support with PHP
- Using HHVM with PHP-FPM Fallback
- Using Redis for PHP Sessions on Ubuntu Server
- Installing PhpMyAdmin Quickly
- Moving PHP's session storage to tmpfs
- Install Xdebug and configure it with Netbeans
- Nginx – Enable PHP-FPM Status Page
- PHP-FPM: Socket vs TCP/IP and sysctl tweaking
- APC Cache Optimization & Monitoring Using Web Interface
- Checking if PHP/WordPress can send mails
- Debugging PHP Scripts Using slow_log and more
- Increase file upload size limit in PHP-Nginx
- Increase PHP script execution time with Nginx
-
- Performance Optimization
- Remove Query string of css/js files
- Setup ElasticSearch with ElasticPress
- Using Redis for WordPress Object-Cache
- WooCommerce Window Shopping Caching Technique
- Moving WordPress To New Server (Faster)
- Better wp-cron using linux's crontab
- 404 error- Page not Found!!!
- Debugging WordPress with Nginx
Adding Chris Lea's Repo
node.js install
npm install
Latest node.js & npm installation on Ubuntu 12.04
Compiling is way to go for many but I am mostly in hurry so following works for me!
Adding Chris Lea’s Repo
Using Launchpad repo by Chris Lea just run following commands
apt-get install python-software-properties
apt-add-repository ppa:chris-lea/node.js
apt-get update
node.js install
apt-get install nodejs
Check node.js version
node -v
Outputs
v0.10.20
npm install
Above command should install npm.
Check npm version
npm -v
Outputs
1.4.3
If for some reason, if you see npm is not installed, you may try running:
apt-get install npm
P.S. Do not miss out on our other amazing tutorials. Stay tuned with us. Join us on twitter and facebook for more updates.
(updated on 20 Feb 2014. After this comment from dodyrw)
Installing ghost with nginx proxy-cache
PREVIOUS
Comments
-
Perfect, Thank you this was very helpful. I needed to install the latest node.js & npm to use the new ghost blogging platform.
-
Glad to know that it helped. I wrote this while installing https://github.com/fzaninotto/uptime (another good node.js project)
-
-
Paul Vollmar
Followed your instructions, but I got the following error when trying to install npm:
user@system:~$ sudo apt-get install npm
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: nodejs-dev
Depends: node-request but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-abbrev but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-fstream but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.Could it be my version of nodejs?
user@system:~$ node -v
v0.10.25
-
Try to install nodejs-dev. I did not encounter this error.
Did you added Chris’s repo as instructed here – https://rtcamp.com/tutorials/nodejs/node-js-npm-install-ubuntu/#adding-chris-leas-repo ?
-
Samuel
Same problem here. Can not install npm, neither nodejs-dev.
-
Why do you need
nodejs-dev?Now,
apt-get install nodejsinstallsnodeandnpm. Updated article to reflect this change.Please try again and let me know if you run into any issue.
-
-
-
-
Paul Vollmar
I did install Chris’s repo as instructed. When I try to install nodejs-dev, I get:
user@system:~$ sudo apt-get install nodejs-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:
nodejs-dev : Depends: nodejs (= 0.8.22-1chl1~precise1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.-
Now,
apt-get install nodejsinstallsnodeandnpm. Updated article to reflect this change.Just try running
npm -v. You should seenpminstalled already.Please let me know if you run into any issue.
-
visteras
Yes, nodejs install node and npm, but npm installing in /usr/bin directory.
Use ln 🙂
root@srv1:/usr/local# ln -s /usr/bin/npm /usr/local/bin/npm
root@srv1:/usr/local# npm -v
1.4.3-
Why did you need `ln` command? `/usr/bin` is also part of $PATH
-
-
-
-
Like the other people here, I also get the same problem when installing npm. I have no problem with the step for nodejs.
I don’t think we need to run: apt-get install npm
Because when I check npm -v, it return the latest version.Thank you for great tutorial, it solve my problem.
-
Thanks for solution. I just tested it on new machine and it looks like npm is not installed automatically with nodejs!
Updated article. Thanks for correction. 🙂
-
-
wayne
Wheezy = https://gist.github.com/x-Code-x/2562576
Now I just need to learn how to use it :).
If anyone can point a total noob in the right direction for learning I would be thankful.Rahul I do not know how you stay on top of everything.
Thank you camp have a good day!
-
That gist has instruction for compiling node.js packages. I think its faster to use pre-compiled packages.
For learning node.js – there are way too many resources. These days, I am learning meteor framework – https://www.meteor.com/ which I believe will be next big thing! 😉
-
Wayne
I wanted to edit/update my comment.
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-managerNode is’nt available in a package for Wheezy, that I am aware of anyway. This link worked well for me.
Good day!
-
I will have a look at node on debian soon. As easyengine supports debian, we need to keep all articles uptodate for debian as well.
-
-
-
-
Thanks, love this way. Quick!.
-
Dzufikar
thank’s a lot, now i have installed node in my ubuntu 🙂
-
Excellent tutorial!
Exactly what I was looking for.
-
Great tutorial. This was actually the fix for one of my projects at my office. It works on Ubuntu 13 too, but I do recommend to uninstall any “stock” version of nodejs (the one present in ubuntu’s repo), while *it does* try to uninstall sometimes it don’t, 2 of my 5 installation did keep the older npm (or nodejs) on the system but it was easy to fix.
Features
- Server Setup & Management
- Site Creation & Management
- Create WP Cloud Sites
- Speed & Caching
- Firewall Protection
- Backups & Recovery
- Logs & Monitoring
- Deployments & Developer Tools
- Team Access & User Permissions
Useful Links
Product
Other Products
Subscribe for curated product updates, tips, and announcements.
"*" indicates required fields
URL
This field is for validation purposes and should be left unchanged.
Email*
SIGN ME UP
Δ
© rtCamp, since 2009. All rights reserved.