Closed Dragomir-Ivanov closed 4 years ago
@Dragomir-Ivanov what version of fbp
package are you using?
Please paste output of npm list | grep fbp
@jonnor drago@T430s:~/SCE/cs-sce1/node_modules/the-graph/themes$ npm list | grep fbp ├── UNMET DEPENDENCY fbp-graph@^0.1.0 npm ERR! missing: @pleasetrythisathome/react.animate@0.0.4, required by the-graph@0.11.1 npm ERR! missing: create-react-class@^15.6.2, required by the-graph@0.11.1 npm ERR! missing: ease-component@^1.0.0, required by the-graph@0.11.1 npm ERR! missing: fbp-graph@^0.1.0, required by the-graph@0.11.1 npm ERR! missing: font-awesome@^4.6.3, required by the-graph@0.11.1 npm ERR! missing: hammerjs@^2.0.8, required by the-graph@0.11.1 npm ERR! missing: klayjs-noflo@^0.3.1, required by the-graph@0.11.1 npm ERR! missing: tv4@^1.3.0, required by the-graph@0.11.1
I got this error: `$ fbp graphs/ssiGeneration.json > graphs/ssiGeneration.fbp C:\Users\fmuser\AppData\Roaming\npm\node_modules\fbp\bin\fbp:25 return console.log(parser.serialize(fs.readFileSync(file, 'utf-8'))); ^
TypeError: parser.serialize is not a function
at Object.
@Mrinaldo and which version of fbp do you have?
I got this error using the latest version 1.7.0, and you can figure out why this happen using the code:
var parser = require('fbp');
// Some FBP syntax code
var fbpData = "'hello, world!' -> IN Display(Output)";
console.log(Object.keys(parser));
// Parse into a Graph definition JSON object
var graphDefinition = parser.parse(fbpData, {caseSensitive: true});
console.log(Object.keys(parser));
and the console outputs:
It since that the parser.serialize
method that using for parse json
was added after parser.parse
was called. That's why we got error using the command fbp
, and this error not happened by using npm run test
because tests defined in spec/fbp.coffee
called the parser.parse
before spec/json.coffee
runs.
: )
Trying to convert JSON to FBP, I get the following.