Node.js¶
Node.js is a popular Javascript runtime that can power web applications. Opalstack provides a simple installer that creates a very basic Node.js web application.
Installation¶
To install a NodeJS application follow our general instructions for adding applications and select "NodeJS" as the application type in step 5.
When the installation is complete, the following files and directories will be present in the application directory:
start
andstop
scripts to control the operation of your application.tmp
: a directory containing temporary files used by your applicationapp.js
: a basic Node.js "Hello World" web applicationREADME
: basic info regarding the new application.
Complete the setup by adding the application to a site.
Installing Node packages with npm¶
You can install additional Javascript packages for your Node.js applications as follows:
-
Switch to your application directory and install the package by running the commands in the example below, replacing
myapp
with the name of your Node.js application andpackagename
with the name of the package that you want to install:cd ~/apps/myapp export PATH=$PWD/node/bin:$PATH npm install packagename