11 articles Node

Node.js! Also powering your control panel!

File uploads in a Passenger-backed application fail

Overview A file upload initiated in an application written in Ruby, Node, or Python launched through Passenger will fail to upload. Thus far, the confirmed failure occurs in RefineryCMS with a generic undefined route message following upload. Cause It is a conflict between upload screening and Passenger, but the underlying cause is not clearly understood. Upload…

Changing Node Versions

Overview Platforms v6.5+ and beyond support multiple Node versions that may be installed using nvm. Usage Listing nvm is provided automatically. First, to list available node interpreters, execute nvm ls from the terminal: $ nvm ls v4.2.4 v5.5.0 -> system node -> stable (-> v5.5.0) (default) stable -> 5.5 (-> v5.5.0) (default) iojs -> N/A (default)…

Spawning multiple TCP daemons in a single app

Overview Node applications may bind to a TCP port using listen(<PORT NUMBER>), provided of course the PORT NUMBER is one allocated to your account. Passenger replaces this listen() method with a built-in method that, instead of listening on a TCP port, creates a local UNIX socket for communication with the web server (see installServer() in source). By creating a socket, no…

Adding npm bin/ path to command search path

Overview npm installs packages by default under node_modules/ within the current working directory. Binary files, if bundled with a package, are installed under node_modules/.bin/ unless the global (-g) flag is supplied to npm install. This works if only a single version of a particular package is installed, but fails in most multi-version setups. Solution Add node_modules/.bin/…

Upgrade npm

Overview When attempting to install newer packages on v6+ platforms, npm may complain that it is too old to install a package. Sample error: Sails.js Installation – Error ——————————————————– Your npm-Version is too old: Sails require npm >= 1.4.0 (you currently have 1.3.6) Please update the installed npm (Node Package Manager) to install Sails. ——————————————————–…

Installing Express

Overview Express is a Node.js framework inspired by Sinatra for Ruby: it’s based on minimalism with a penchant for performance. Express is part of the MEAN fullstack: MongoDB, Express, Angular.js, and Node.js. MongoDB may be setup in a separate guide. Express is supported on all v6+ platforms using Passenger to manage isolated processes. Quickstart All steps are done from the terminal:…

Viewing launcher errors

Overview Applications launched by Passenger on v6+ platforms may emit output on stdout or stderr channels. Any output emitted is logged to an aggregate log called passenger.log in /var/log. Important: since these logs are combined among all accounts using Passenger, never output anything confidential to stdout or stderr when launched using Passenger. Once an application is up and…

Running Meteor

Overview Meteor is a web framework written on top of Node.js. Meteor hooks into Passenger for seamless process launching and flexible, agile scalability. Meteor requires terminal access to use. This guide covers launching Meteor on a v6+ platform. Quickstart PREREQUISITE: follow the MongoDB tutorial to setup MongoDB. Install Meteor from the terminal: cd ~ curl https://install.meteor.com/ | sh…

Installing Ghost

Overview Ghost is a gorgeous blogging platform supported on Developer+ accounts on v6+ platforms. Ghost requires terminal access to deploy and hooks into Passenger affording simple process management.   Quickstart This guide is designed to get Ghost up and running with the fewest steps. Ghost will be SQLite as a database backend, but you might…