noflo fist program - deprecation warning

30 views Asked by At

I am new to NoFlo and I am trying to do the examples found in the documentation. As in the doc I run

cd test_js_project
./node_modules/.bin/noflo-nodejs --graph graphs/ShowContents.fbp --batch

but I got a deprecation error

Providing a callback to NoFlo.createNetwork is deprecated, use Promises
(node:29446) UnhandledPromiseRejectionWarning: TypeError: callback is not a function
    at MY_PATH_TO_JS/test_js_project/node_modules/noflo/lib/NoFlo.js:155:13
(node:29446) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29446) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
<Buffer 7b 0a 20 20 22 6e 61 6d 65 22 3a 20 22 74 65 73 74 5f 6a 73 5f 70 72 6f 6a 65 63 74 22 2c 0a 20 20 22 76 65 72 73 69 6f 6e 22 3a 20 22 30 2e 30 2e 31 ... 239 more bytes>

I installed everything new with npm. How should I fix this error and run the program?


UPDATE

It seems that in Debian to get the latest Node.js version one should add the repository to the list. Following the instructions in the previous link I switch v12.22.12 to v21.2.0.

... the error is still there but much more compact

./node_modules/.bin/noflo-nodejs --graph graphs/ShowContents.fbp --batch
Providing a callback to NoFlo.createNetwork is deprecated, use Promises
callback is not a function
TypeError: callback is not a function
    at MY_PATH_TO_JS/js/test_js_project/node_modules/noflo/lib/NoFlo.js:155:13

To be sure I update the package manager to latest version

npm update
sudo npm install -g [email protected]

and here my project dependencies

cat package.json 
{
  "name": "test_js_project",
  "version": "0.0.1",
  "dependencies": {
    "noflo": "^1.4.3",
    "noflo-core": "^0.6.1",
    "noflo-filesystem": "^2.2.0",
    "noflo-math": "^0.4.0",
    "noflo-nodejs": "^0.11.1",
    "webpack": "^5.89.0"
  },
  "devDependencies": {
    "install": "^0.13.0",
    "noflo-component-loader": "^0.4.1",
    "npm": "^10.2.4"
  }
}
0

There are 0 answers