Confused about npm installs.

I’m looking to install node-red-node-beaglebone on 2016-03-27 image. These instructions seem clear:

cd ~/.node-red (which would be /root/.node-red)
sudo npm install -g --unsafe-perm node-red-node-beaglebone

Although I note that the instructions to edit ~/.node-red/settings.js and un-comment the bonescript:require(‘bonescript’) line have been removed.

But next I want to install johnny-five beaglebone-io but the instructions here:
say to create a directory under the cloud9 tree and cd into it before running (as root):
npm install johnny-five beaglebone-io

Finally for node-red-contrib-gpio instructions at:
say to cd into my node-red directory (presumably /root/.node-red) and run:
npm install node-red-contrib-gpio (presumably as root)

The first and third seem clear although its not clear if I need or want the -g --unsafe-perm options for the third step.
For the second step, how is npm and node-red going to find the path to the directory I created? or does npm automagically create paths to find everything?

I’m I worrying about nothing?
The first step is in progress, but I prefer clarification instead of a host of posts trying to figure out where I went wrong if I’ve not got the correct installation procedure before doing the other two.

As it proceeds, I’m seeing errors and warnings, but at the end it printed out directory tree-like diagram rooted at /usr/local/lib.

The node-red-node-beaglebone install appears to have failed, as when I restarted I don’t see any of the beaglebone nodes in the nodes pane on the right side of the Node-RED page.

The johnny-five beaglebone-io didn’t go any better :frowning:
as root:

cd .node-red
npm install -g --unsafe-perm johnny-five beaglebone-io

npm ERR! Linux 4.1.18-ti-r55
npm ERR! argv “node” “/usr/local/bin/npm” “install” “-g” “–unsafe-perm” “johnny-five” “beaglebone-io”
npm ERR! node v0.12.12
npm ERR! npm v3.8.2

npm ERR! ffi@1.2.6 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi@1.2.6 install script ‘node-gyp rebuild’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ffi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ffi
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls ffi
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/.node-red/npm-debug.log