In step 2, do we cd to the folder of nodejs installation, or the drupal nodejs module?
Also, what is the server.js file?
Updated the documentation page.
In step 2, we need to move in to
nodejs module folder inside your drupal's sites directory. Install the dependencies using package manager(npm). Most probably the
nodejs module is installed at
Also don't get confused by these notation (
path/to/your/nodejs/module/directory). It used to say that it exist in some directory.
server.js holds the code related to your express application from configuring your app to starting your app. Express will be installed in your
node_modules folder when you install the dependencies.
node_modules will be created in you
nodejs module(drupal site).
node server.js starts the express application from the location where server.js file is present.
Also you can follow the tutorial links provided by No Sssweat.
As pointed out by Neograph734 in the answer, the current Node.js integration documentation is outdated, and the working instructions for setting up the node.js server with Drupal is in the Node.js Integration readme.txt file.
npm install drupal-node.js, and then run
node app.js in the drupal-node.js folder, where app.js replaces the old server.js in the current Node.js Integration documentattion.