--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have been trying to install node-red but have been unable to successfully complete the task. Any help would be appreciated.
I installed the node-v0.10.36.pkg just fine. then I went to terminal to install node-red as follows.
sudo npm install -g node-red
after entering the admin password I get the following results:
--------------------------------------------------------------
> bcr...@0.8.1 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
> node-gyp rebuild
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found
npm WARN optional dep failed, continuing bcr...@0.8.1
> node-icu-charset-detector@0.0.7 install /usr/local/lib/node_modules/node-red/node_modules/irc/node_modules/node-icu-charset-detector
> node-gyp rebuild
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found
npm WARN optional dep failed, continuing node-icu-charset-detector@0.0.7
Ah - that's what I get for just reading the online instructions (http://nodered.org/docs/getting-started/installation.html, which doesn't provide complete instructions). And for forgetting what I'd done in my prior install - the grunt build.
Thanks!
On Thursday, April 30, 2015 at 1:09:35 AM UTC-4, Vincent Weston wrote:
I have been trying to install node-red but have been unable to successfully complete the task. Any help would be appreciated.
I installed the node-v0.10.36.pkg just fine. then I went to terminal to install node-red as follows.
sudo npm install -g node-red
after entering the admin password I get the following results:
--------------------------------------------------------------
> bcr...@0.8.1 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
> node-gyp rebuild
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found
npm WARN optional dep failed, continuing bcr...@0.8.1
> node-icu-cha...@0.0.7 install /usr/local/lib/node_modules/node-red/node_modules/irc/node_modules/node-icu-charset-detector
> node-gyp rebuild
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-gyp: command not found
npm WARN optional dep failed, continuing node-icu-cha...@0.0.7
--
$ npm install -g node-gyp
Thanks
--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
/*jshint devel: true, node: true*/
/**
* Start an embedded Node-Red instance
*/
var http = require('http'),
express = require("express"),
path = require("path"),
_ = require("lodash"),
RED = require("node-red"),
fs = require("fs"),
lame = require("lame"),
Speaker = require("speaker")
;
// Config vars - NB: LAN details are LOCAL. If accessing from the WAN (Internet), use the WAN details instead
var mqttSrv = '192.168.1.167', // The LAN address for the MQTT server
mqttWsPort = '9001', // The LAN port for the websocket interface to the MQTT server
nrSrv = '192.168.1.167', // The LAN address for this Node-Red server
nrPort = '8000' // The LAN port for this systems web interface
;
var wanMqttSrv = '192.168.1.167', // The WAN address for the MQTT server
wanMqttWsPort = '9001', // The WAN port for the websocket interface to the MQTT server
wanNrSrv = '192.168.1.167', // The WAN address for this Node-Red server
wanNrPort = '8000' // The WAN port for this systems web interface
;
// Create an Express app
var app = express();
// Add a simple route for static content served from 'public'
app.use("/", express.static("public"));
// Add static route for bower components
app.use('/bower_components', express.static( path.join(__dirname, '/bower_components') ) );
// Create a server
var httpServer = http.createServer(app);
// Create the settings object - see default settings.js file for other options
var nrSettings = {
httpAdminRoot: "/red", // Access the admin web i/f from http://<nrSrv>/red
httpNodeRoot: "/", // Access other NR served pages from http://<nrSrv>/
userDir: path.join(__dirname, '.nodered'), // default: $HOME/.node-red
nodesDir: path.join(__dirname, 'nodes'), // adds extra locn, defaults are userDir/nodes & node-red/nodes
verbose: true, // For better debugging
debugMaxLength: 1000, // max length of debug output
paletteCategories: [
'subflows', 'input', 'output', 'function', 'storage', 'advanced', 'formats', 'Raspberry Pi', 'social', 'analysis'
],
functionGlobalContext: { // enables global context
// os:require('os'),
// arduino:require('duino') // directly control Arduino's over serial, https://www.npmjs.com/package/duino
// -- Pass config variables into NR for reference -- //
'mqttSrv' : mqttSrv,
'mqttWsPort' : mqttWsPort,
'nrSrv' : nrSrv,
'nrPort' : nrPort,
'wanMqttSrv' : wanMqttSrv,
'wanMqttWsPort' : wanMqttWsPort,
'wanNrSrv' : wanNrSrv,
'wanNrPort' : wanNrPort,
// Pass in the path library for cross-platform file system specs
'path' : path,
'fs' : fs,
'_' : _,
'lame' : lame,
'Speaker' : Speaker
}
//httpStatic: '/home/pi/node/nr/static', // only for standalone NR
};
// Initialise the runtime with a server and settings
RED.init(httpServer, nrSettings);
// Serve the editor UI from /red
app.use(nrSettings.httpAdminRoot, RED.httpAdmin);
// Serve the http nodes UI from /
app.use(nrSettings.httpNodeRoot, RED.httpNode);
httpServer.listen(8000);
// Start the runtime
RED.start();
--
Julian, forgive me but the real truth is that installing on a Mac should only require the simple commands we use. For some reason this failed for Vincent as npm and/or gyp was not available correctly. This would most likely still fail if trying to install it embedded, so he would be no better off.
As Nick said yours is a perfectly valid approach and can be very useful, but we would rather try to work out and debug why the default install of node.js didn't create the necessary environment for the basic install to succeed.