Help with Mac OS X Yosemite install of node-red

1,027 views
Skip to first unread message

Vincent Weston

unread,
Apr 30, 2015, 1:09:35 AM4/30/15
to node...@googlegroups.com
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

> buffe...@1.0.1 install /usr/local/lib/node_modules/node-red/node_modules/ws/node_modules/bufferutil
> 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 buffe...@1.0.1

> utf-8-v...@1.0.1 install /usr/local/lib/node_modules/node-red/node_modules/ws/node_modules/utf-8-validate
> 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 utf-8-v...@1.0.1

> ic...@2.1.6 install /usr/local/lib/node_modules/node-red/node_modules/irc/node_modules/iconv
> 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 ic...@2.1.6
/
> seria...@1.4.10 install /usr/local/lib/node_modules/node-red/node_modules/serialport
> node-pre-gyp install --fallback-to-build

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
sh: node-pre-gyp: command not found

npm ERR! seria...@1.4.10 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the seria...@1.4.10 install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "node-red"
npm ERR! cwd /Users/Juanita
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

--------------------------------------------------------------

My PATH is as follows:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
Not sure how to proceed. Can't seem to find any info regarding this error on install.

Any help would be appreciated.

Thanks

Mark Setrem

unread,
Apr 30, 2015, 2:59:29 AM4/30/15
to node...@googlegroups.com
You don't say if you have got Xcode - https://macappsto.re/gb/Bk9QD.m installed?

and also the xCode Command Line Tools?

To install the command line tools type:

xcode-select --install

into a terminal.



mfeb

unread,
Apr 30, 2015, 11:45:23 AM4/30/15
to node...@googlegroups.com
I had trouble yesterday, too. The npm install appeared to complete, but left these two issues unresolved, and when trying to run it complained "Node-RED has not been built. See README.md for details". This is the same after updating XCode and verifying that commandline tools were installed. (FYI, I'm at OS X 10.10.3)

  CXX(target) Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o
../node-icu-charset-detector.cpp:5:10: fatal error: 'unicode/ucsdet.h' file not found
#include <unicode/ucsdet.h>
         ^
1 error generated.
make: *** [Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mfeb/node-red/node_modules/irc/node_modules/node-icu-charset-detector
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing node-icu-cha...@0.0.7
 
> bcr...@0.8.1 install /Users/mfeb/node-red/node_modules/bcrypt
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../src/bcrypt_node.cc:1:
In file included from ../node_modules/nan/nan.h:63:
../node_modules/nan/nan_new.h:207:43: error: inline declaration of 'NanNew' follows non-inline definition
template <typename T> inline v8::Local<T> NanNew(v8::Handle<T> h);
                                          ^
../node_modules/nan/nan_implementation_pre_12_inl.h:210:1: note: previous definition is here
NanNew(v8::Handle<T> h) {
^
In file included from ../src/bcrypt_node.cc:1:
In file included from ../node_modules/nan/nan.h:63:
../node_modules/nan/nan_new.h:208:43: error: inline declaration of 'NanNew' follows non-inline definition
template <typename T> inline v8::Local<T> NanNew(v8::Persistent<T> const& p);
                                          ^
../node_modules/nan/nan_implementation_pre_12_inl.h:216:1: note: previous definition is here
NanNew(v8::Persistent<T> const& p) {
^
2 errors generated.
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mfeb/node-red/node_modules/bcrypt
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing bcr...@0.8.1
 
> utf-8-v...@1.0.1 install /Users/mfeb/node-red/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

Nicholas O'Leary

unread,
Apr 30, 2015, 12:04:24 PM4/30/15
to Node-RED Mailing LIst
Mark,

those are warnings about optional dependencies, they are not fatal.

The warning "Node-RED has not been built. See README.md for details" means exactly what it says. You are trying to run the code straight from git without running the node-red build. As the message says, everything you need to know is in the node-red README file.

Nick

--
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.

mfeb

unread,
Apr 30, 2015, 2:14:05 PM4/30/15
to node...@googlegroups.com
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-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

Nicholas O'Leary

unread,
Apr 30, 2015, 2:16:12 PM4/30/15
to Node-RED Mailing LIst
Indeed - the online instructions are for end users, not developers.... we don't encourage people to run straight from git unless they know what they are doing.

Nick

On 30 April 2015 at 19:14, mfeb <mfebl...@gmail.com> wrote:
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

--

Vincent Weston

unread,
Apr 30, 2015, 5:17:43 PM4/30/15
to node...@googlegroups.com
I do have xcode installed xcode 6.3

and I do have command line tools installed but tried your command as well and get this:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

hope this helps figure this out.

Thanks

Vincent Weston

unread,
Apr 30, 2015, 6:04:25 PM4/30/15
to node...@googlegroups.com
OK,

I followed the alternative install by downloading a .zip file and then

cd /Users/user/Downloads/node-red-0.10.6

sudo npm install --production

and I get the following:
-------------------------------------

> node-icu-cha...@0.0.7 install /Users/vweston/Downloads/node-red-0.10.6/node_modules/irc/node_modules/node-icu-charset-detector
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing node-icu-cha...@0.0.7

> bcr...@0.8.1 install /Users/vweston/Downloads/node-red-0.10.6/node_modules/bcrypt
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing bcr...@0.8.1

> utf-8-v...@1.0.1 install /Users/vweston/Downloads/node-red-0.10.6/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing utf-8-v...@1.0.1

> buffe...@1.0.1 install /Users/vweston/Downloads/node-red-0.10.6/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing buffe...@1.0.1
|
> ic...@2.1.6 install /Users/vweston/Downloads/node-red-0.10.6/node_modules/irc/node_modules/iconv
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing ic...@2.1.6
/
> seria...@1.4.10 install /Users/vweston/Downloads/node-red-0.10.6/node_modules/serialport
> node-pre-gyp install --fallback-to-build

[serialport] Success: "/Users/vweston/Downloads/node-red-0.10.6/node_modules/serialport/build/serialport/v1.4.10/Release/node-v11-darwin-x64/serialport.node" is installed via remote
is-...@0.2.0 node_modules/is-utf8

on-he...@1.0.0 node_modules/on-headers

cl...@0.2.0 node_modules/clone

twitt...@0.6.2 node_modules/twitter-ng

must...@1.0.0 node_modules/mustache

passport-oauth2...@0.1.2 node_modules/passport-oauth2-client-password
└── passport...@1.0.0

oa...@0.9.12 node_modules/oauth

no...@3.0.1 node_modules/nopt
└── abb...@1.0.5

pass...@0.2.1 node_modules/passport
├── pa...@0.0.1
└── passport...@1.0.0

fs.n...@0.0.4 node_modules/fs.notify
├── re...@0.6.1
└── as...@0.1.22

co...@2.5.3 node_modules/cors
└── va...@1.0.0

bcry...@2.1.0 node_modules/bcryptjs

follow-r...@0.0.3 node_modules/follow-redirects
└── under...@1.8.3

oauth...@1.0.1 node_modules/oauth2orize
├── ui...@0.0.3
├── utils...@1.0.0
└── de...@0.7.4

passport-h...@1.0.1 node_modules/passport-http-bearer
└── passport...@1.0.0

mkd...@0.5.0 node_modules/mkdirp
└── mini...@0.0.8

wh...@3.7.2 node_modules/when

raw-...@1.3.2 node_modules/raw-body
├── by...@1.0.0
└── iconv...@0.4.6

w...@0.7.1 node_modules/ws
├── opt...@0.0.6
└── ult...@1.0.1

mq...@0.3.13 node_modules/mqtt
└── readabl...@1.0.33 (isa...@0.0.1, inhe...@2.0.1, string_...@0.10.31, core-u...@1.0.1)

fs-e...@0.16.3 node_modules/fs-extra
├── json...@2.0.0
├── grace...@3.0.6
└── rim...@2.3.3 (gl...@4.5.3)

ugli...@2.4.16 node_modules/uglify-js
├── uglify-to-...@1.0.2
├── as...@0.2.10
├── opti...@0.3.7 (word...@0.0.2)
└── sourc...@0.1.34 (amde...@0.1.0)

req...@2.42.0 node_modules/request
├── case...@0.6.0
├── json-stri...@5.0.0
├── aws-...@0.5.0
├── foreve...@0.5.2
├── string...@0.0.4
├── oauth...@0.4.0
├── tunnel...@0.4.0
├── q...@1.2.2
├── node...@1.4.3
├── mime-...@1.0.2
├── http-si...@0.10.1 (asser...@0.1.5, as...@0.1.11, ct...@0.5.3)
├── form...@0.1.4 (mi...@1.2.11, as...@0.9.0, combine...@0.0.7)
├── b...@0.9.4 (readabl...@1.0.33)
├── tough-...@1.1.0
└── ha...@1.1.1 (cryp...@0.2.2, sn...@0.2.4, bo...@0.4.2, ho...@0.9.1)

im...@0.8.14 node_modules/imap
├── ut...@1.0.0
└── readabl...@1.1.13 (isa...@0.0.1, inhe...@2.0.1, string_...@0.10.31, core-u...@1.0.1)

nodem...@1.3.0 node_modules/nodemailer
├── nodemailer-s...@0.1.13 (nodemailer...@0.1.5, smtp-co...@1.2.0)
├── hyper...@0.3.0 (dupl...@0.1.1, thr...@2.2.7)
├── nodemailer-di...@1.0.2 (smtp-co...@1.2.0)
├── lib...@0.1.7 (libb...@0.1.0, li...@0.1.1, iconv...@0.4.8)
└── buil...@1.2.4 (li...@1.0.0, addres...@0.3.2, libb...@0.1.0, hyper...@1.2.0, lib...@1.0.0)

sent...@0.2.3 node_modules/sentiment
├── as...@0.2.10
└── lod...@1.3.1

feedp...@0.19.2 node_modules/feedparser
├── array-ind...@0.0.1
├── addres...@0.1.3
├── readabl...@1.0.33 (isa...@0.0.1, inhe...@2.0.1, string_...@0.10.31, core-u...@1.0.1)
├── resan...@0.3.0 (vali...@1.5.1)
└── s...@0.6.1

exp...@3.17.2 node_modules/express
├── basic...@1.0.0
├── merge-de...@0.0.2
├── fr...@0.2.4
├── coo...@0.1.2
├── escap...@1.0.1
├── range-...@1.0.2
├── cookie-s...@1.0.5
├── va...@1.0.0
├── media...@0.3.0
├── met...@1.1.0
├── pars...@1.3.0
├── de...@0.4.5
├── c...@3.0.0
├── de...@2.0.0 (m...@0.6.2)
├── comm...@1.3.2 (keyp...@0.1.0)
├── proxy...@1.0.1 (ipad...@0.1.2)
├── se...@0.9.2 (des...@1.0.3, et...@1.3.1, m...@0.6.2, on-fi...@2.1.0, mi...@1.2.11)
└── con...@2.26.1 (pa...@0.0.1, respon...@2.0.1, vh...@3.0.0, finalh...@0.2.0, basic-aut...@1.0.0, by...@1.0.0, method-...@2.2.0, connect...@1.3.0, cookie...@1.3.4, q...@2.2.3, mor...@1.3.2, serve-...@2.1.7, serve-...@1.6.5, typ...@1.5.7, multi...@3.3.2, body-...@1.8.4, errorh...@1.2.4, cs...@1.6.6, express...@1.8.2, compr...@1.1.2, serve...@1.2.1)

che...@0.18.0 node_modules/cheerio
├── enti...@1.1.1
├── dom-ser...@0.0.1 (domelem...@1.1.3)
├── htmlp...@3.8.2 (domelem...@1.3.0, domu...@1.5.1, enti...@1.0.0, domha...@2.3.0, readabl...@1.1.13)
├── CSSs...@0.4.1 (domu...@1.4.3, CSS...@0.4.7)
└── lod...@2.4.2

xml...@0.4.4 node_modules/xml2js
├── s...@0.6.1
└── xmlbu...@2.6.2 (lod...@3.5.0)

i...@0.3.9 node_modules/irc
├── ansi-...@0.2.1
└── irc-c...@1.1.0 (has...@0.0.4)

cr...@1.0.6 node_modules/cron
└── moment-...@0.2.4 (mom...@2.10.2)

seria...@1.4.10 node_modules/serialport
├── bind...@1.2.1
├── s...@0.1.7
├── as...@0.9.0
├── n...@1.3.0
└── opti...@0.6.1 (word...@0.0.2, mini...@0.0.10)

-------------------------------------

I have no idea where it resides but looks like some success. To start it I used the following:

node red.js

and then in browser to localhost:1880

looks good. then went to install a flow per their instructions as follows:

mkdir -p ~/.node-red/node_modules
npm install --prefix ~/.node-red node-red-contrib-bean

I get the error -bash: npm: command not found
So I enter:

sudo npm install --prefix ~/.node-red node-red-contrib-bean

and get the following:
_________________________

|
> xpc-con...@0.1.3 install /Users/vweston/.node-red/node_modules/node-red-contrib-bean/node_modules/ble-bean/node_modules/noble/node_modules/xpc-connection
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing xpc-con...@0.1.3

> no...@0.3.14 install /Users/vweston/.node-red/node_modules/node-red-contrib-bean/node_modules/ble-bean/node_modules/noble
> node-gyp rebuild

sh: node-gyp: command not found

npm ERR! no...@0.3.14 install: `node-gyp rebuild`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the no...@0.3.14 install script.
npm ERR! This is most likely a problem with the noble 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 their info via:
npm ERR! npm owner ls noble
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--prefix" "/Users/vweston/.node-red" "node-red-contrib-bean"
npm ERR! cwd /Users/vweston/Downloads/node-red-0.10.6
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

_________________________

So progress, but still not right. $PATH looks fine but my alias to npm says it needs fixing and I can't find any node-gyp

I'm very confused.

Thanks

Edward Vielmetti

unread,
Apr 30, 2015, 6:10:44 PM4/30/15
to node...@googlegroups.com
Try

$ 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.

Vincent Weston

unread,
Apr 30, 2015, 7:18:58 PM4/30/15
to node...@googlegroups.com
OK, I did

sudo npm install -g node-gyp

and I get:

---------------------------------------

/usr/local/bin/node-gyp -> /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
node...@1.0.3 /usr/local/lib/node_modules/node-gyp
├── wh...@1.0.9
├── rim...@2.3.3
├── os...@0.1.0
├── grace...@3.0.6
├── sem...@4.3.3
├── no...@3.0.1 (abb...@1.0.5)
├── mkd...@0.5.0 (mini...@0.0.8)
├── fst...@1.0.4 (inhe...@2.0.1)
├── t...@1.0.3 (inhe...@2.0.1, block-...@0.0.7)
├── mini...@1.0.0 (sig...@1.0.0, lru-...@2.6.2)
├── gl...@4.5.3 (inhe...@2.0.1, on...@1.3.1, infl...@1.0.4, mini...@2.0.7)
├── npm...@1.2.0 (an...@0.3.0, are-we-t...@1.0.4, ga...@1.2.0)
└── req...@2.55.0 (case...@0.9.0, json-stri...@5.0.0, aws-...@0.5.0, foreve...@0.6.1, string...@0.0.4, tunnel...@0.4.0, oauth...@0.6.0, isst...@0.1.2, node...@1.4.3, q...@2.4.1, form...@0.2.0, mime-...@2.0.10, tough-...@1.1.0, http-si...@0.10.1, b...@0.9.4, combine...@0.0.7, ha...@2.3.1, har-va...@1.7.0)

----------------------------------------
Then if I do the stall for a flow I still get an error:

sudo npm install --prefix ~/.node-red node-red-contrib-bean

I get:

_______________________________

/
> xpc-con...@0.1.3 install /Users/vweston/.node-red/node_modules/node-red-contrib-bean/node_modules/ble-bean/node_modules/noble/node_modules/xpc-connection
> node-gyp rebuild

sh: node-gyp: command not found
npm WARN optional dep failed, continuing xpc-con...@0.1.3

> no...@0.3.14 install /Users/vweston/.node-red/node_modules/node-red-contrib-bean/node_modules/ble-bean/node_modules/noble
> node-gyp rebuild

sh: node-gyp: command not found

npm ERR! no...@0.3.14 install: `node-gyp rebuild`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the no...@0.3.14 install script.
npm ERR! This is most likely a problem with the noble 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 their info via:
npm ERR! npm owner ls noble
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--prefix" "/Users/vweston/.node-red" "node-red-contrib-bean"
npm ERR! cwd /Users/vweston
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
_______________________________

I now have an alias "node-gyp" in /usr/local/bin but if I click on it and show original is says:

The alias “node-gyp” can’t be opened because the original item can’t be found.

if I type node-gyp i get:

-bash: node-gyp: command not found

if I type

sudo node-gyp

i get:

Usage: node-gyp <command> [options]

where <command> is one of:
- build - Invokes `make` and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates a Makefile for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version

node...@1.0.3 /usr/local/lib/node_modules/node-gyp
no...@0.10.36


If this helps any.

Where is node-gyp suppose to be located?

Vincent Weston

unread,
May 1, 2015, 12:40:20 AM5/1/15
to node...@googlegroups.com
Thanks everyone. Not sure how I got it, but I think I have it working. Definitely unconventional. Anyone know where the node-red-0.10.6 folder with red.js is suppose to be located. I had to build node-red the hard way and mine is in my Downloads folder. where do I need to copy it to.

I will be playing with it so I will be keeping my fingers crossed.

Thanks again

Andrew Lindsay

unread,
May 1, 2015, 2:24:18 AM5/1/15
to node...@googlegroups.com
As a Mac noob using the npm install was easiest method for me.

Cheers

Andrew

Julian Knight

unread,
May 1, 2015, 3:48:27 AM5/1/15
to node...@googlegroups.com
If you need full control, I've found it easiest to install as just another module to your own "project". Install Node.JS (which should install npm globally). Create a convenient folder anywhere, In that folder do "npm init" & follow the instructions. Edit the resulting package.json and add dependencies for node-red and any nodes and other packages you want. Then do "npm install".

If all has gone to plan, you now only need to create a startup js file containing the details from the node-red docs site for an embedded version. Here is mine:

/*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();
No
That is on a Pi rather than a Mac but the principles are the same.

Hope that helps. J.

mfeb

unread,
May 1, 2015, 8:48:00 AM5/1/15
to node...@googlegroups.com
I’m still getting accustomed to the options.

On a Mac, a global install puts the files in /usr/local/lib/node_modules. A local install puts them wherever you want them (Downloads is not a good final resting place:) or wherever you are when you do the "npm install”.

When you do a global install of node-red, user files default to ~/.node-red, and that can be overridden.

Right now I’m using ~/.node-red for my dependencies (which get placed under ~/.node-red/node_modules). The trouble with that is that it’s not so easy to segregate the node modules for separate projects, so I think I’ll eventually create separate project directories with separate (sometimes duplicate) dependencies.

For those node dependencies that I use across multiple projects, I’m installing those modules globally (with the -g option, using sudo). They’ll end up in /usr/local/lib/node_modules.

One thing to avoid doing is intermixing user files with node-red install files (e.g., putting your files under the unzip director or the git clone directory). It gets harder to upgrade/reinstall node-red and to figure out how to disentangle your own nodes from the core node-red nodes.

One thing I forget, in these early learning days, is to cd to the intended destination of the local npm installs. Then I have node_modules directories wherever I was at the time, and node-red doesn’t find them.

Julian Knight

unread,
May 1, 2015, 1:01:40 PM5/1/15
to node...@googlegroups.com
Sorry to keep going on about this but if you install NR in embedded form, the NR files all go into a subfolder of node_modules and so are out of the way. You can then set your user files to be a folder in your project folder without any fear of them being blitzed.

Nicholas O'Leary

unread,
May 1, 2015, 1:05:07 PM5/1/15
to Node-RED Mailing LIst
Julian,

yes, but the technical overhead of setting that up makes it a non-starter for new users.

The default setup, a global install of node-red, with userDir defaulting to $HOME/.node-red achieves exactly the same separation of concerns with a single npm install command and doesn't require the user creating their own launch script, their own package.json etc etc.

I'm not saying it isn't a valid way of running, I would just ask you don't keep recommending it as a sensible way to run for new users.

Nick

--

Edward Vielmetti

unread,
May 1, 2015, 2:26:43 PM5/1/15
to node...@googlegroups.com
Nick - 

There needs to be a reasonably well thought out sensible way to run for developers, where you need to possibly tweak dependencies of every module you are using, and run code that might not work. I think Julian's approach opens my eyes to a way to do that which is very useful.

thanks

Ed

Nicholas O'Leary

unread,
May 1, 2015, 2:36:59 PM5/1/15
to Node-RED Mailing LIst
I don't disagree at all with that. We've been focused on the getting started experience for new users as that is key to the overall node-red user experience.

One of the things we suffered from early on was the many different ways you could install/run node-red - git clone/npm install/zip download.... This led to all sorts of struggles to help users as you had to figure out what they had done to get to where they were. This is why we've tried to simplify the instructions to a single npm install -g command. I don't always find it helpful to throw lots of alternative ideas at someone who is still getting to grips with what the official docs say. We've seen on the list where that leads to more support questions then they solve.

We will be expanding our docs for the more development-minded user, with some more tip as to how best to setup your environment if you are creating nodes etc.

There are also scenarios where what Julian describes is absolutely a sensible way to do things - and we will be documenting a guide for that as well.



Nick


Julian Knight

unread,
May 1, 2015, 3:11:36 PM5/1/15
to node...@googlegroups.com
Well I get that Nick but truth is that, in this case, the standard installation seems to be more confusing for the way that Vincent works and is set up in any case so actually, the embedded version may well be easier.
The point I was trying to make about where the user files are was secondary - that you can - if you want - put things elsewhere not that you have to.

Vincent seems perfectly comfortable with the innards of his Mac so is hardly a newbie in that sense.

In terms of npm, users will still be doing other npm installs to get all the nodes they want, actually a single package.json is simpler. NR just becomes one single more dependency and that is the Node.JS "way". The startup script is only a few lines longer than the settings file you would amend anyway and is just a copy/paste to get you going. And you no longer have to worry about a global package install with the complexities of administrator rights.

It isn't like people are going to be able to get into NR without some skills. Don't get me wrong, I love it and it makes many things vastly easier. But you still need to understand a bit about how Node.JS works, some JavaScript and roughly how HTTP works. NR will help you learn it is true but you are going to get your hands dirty, getting NR going from the package.json and a startup script is as easy as explaining where the user files have now gone to.

I'm not criticising your approach to the standard install, just pointing out that it probably doesn't fit for everyone and the alternative is really just as straight-forward.

Dave C-J

unread,
May 1, 2015, 7:20:06 PM5/1/15
to node...@googlegroups.com

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.

Julian Knight

unread,
May 2, 2015, 4:32:13 AM5/2/15
to node...@googlegroups.com
No worries. Of course you need to sort out what is wrong. As you've probably already realised, I rather like being in control of the machine so I gravitate towards methods that give me the level of control I want.
Reply all
Reply to author
Forward
0 new messages