Search code examples
node.jsnoflo

Attempting to list noflo node modules leads to Syntax Error


I'm following the documentation on how to get NoFlo up and running. Just prior to the section "Defining your first graph" there is a line which says that I can see the list of installed componenents by typing

$ ./node_modules/.bin/noflo list .

However, doing so leads to the stack backtrace below. The first few lines of the program that noflo is barfing on are:

if typeof process isnt 'undefined' and process.execPath and process.execPath.indexOf('node') isnt -1
  noflo = require "../../lib/NoFlo"
else
  noflo = require '../lib/NoFlo'

class Graph extends noflo.Component
  constructor: ->
    @network = null
    @ready = true
    @started = false
    @baseDir = null
    @loader = null

Transcript of shell session follows

tbrannon@tbrannon0:~/Documents/Programming/noflo/my-noflo-example-app$ ./node_modules/.bin/noflo list .

/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/src/components/Graph.coffee:1 (function (exports, require, module, __filename, __dirname) { if typeof proces ^^^^^^ SyntaxError: Unexpected token typeof at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at ComponentLoader.load (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/lib/ComponentLoader.js:127:26) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/bin/noflo.js:115:36 at Function..each..forEach (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/underscore/underscore.js:87:22) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/bin/noflo.js:113:18 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/lib/nodejs/ComponentLoader.js:132:16 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/underscore/underscore.js:758:21 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/lib/nodejs/ComponentLoader.js:152:18 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/lib/nodejs/ComponentLoader.js:39:16 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/underscore/underscore.js:758:21 at ComponentLoader.getModuleComponents (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/lib/nodejs/ComponentLoader.js:61:16) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/lib/nodejs/ComponentLoader.js:146:22 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:118:5 at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at cb (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:48:11) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at cb (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:48:11) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at cb (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:48:11) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at cb (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:48:11) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at cb (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:48:11) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at cb (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:48:11) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:234:14 at asyncMap (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/node_modules/slide/lib/async-map.js:27:18) at next (/usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:200:5) at /usr/local/g7/home/tbrannon/Documents/Programming/noflo/my-noflo-example-app/node_modules/noflo/node_modules/read-installed/read-installed.js:157:7 at LOOP (fs.js:1356:14) at process._tickCallback (node.js:415:13)

tbrannon@tbrannon0:~/Documents/Programming/noflo/my-noflo-example-app$


Solution

  • This issue is caused by an API change in CoffeeScript 1.7. A fix was made in NoFlo's git repository.

    The fix was included in NoFlo 0.4.4 available via NPM.