BPMN Auto Layout Not working

Hi,

I have downloaded this project from the github, https://github.com/bpmn-io/bpmn-auto-layout
Installation was done as said, but when I run the project I am getting below error

 1) bpmn-auto-layout
       should layout
         process-diagram:
     TypeError: Cannot read property 'readFile' of undefined
      at test (test\AutoLayoutSpec.js:37:31)
      at Context.<anonymous> (test\AutoLayoutSpec.js:57:13)

  2) bpmn-auto-layout
       should layout
         multiple start events:
     TypeError: Cannot read property 'readFile' of undefined
      at test (test\AutoLayoutSpec.js:37:31)
      at Context.<anonymous> (test\AutoLayoutSpec.js:67:13)

  3) bpmn-auto-layout
       should layout
         nested sub-process:
     TypeError: Cannot read property 'readFile' of undefined
      at test (test\AutoLayoutSpec.js:37:31)
      at Context.<anonymous> (test\AutoLayoutSpec.js:72:13)

  4) bpmn-auto-layout
       "after all" hook in "bpmn-auto-layout":
     TypeError: Cannot read property 'readdir' of undefined
      at Context.after (test\AutoLayoutSpec.js:95:37)

can anyone suggest me how to fix the above error please.

This sounds like a local problem to me, so that the fs module does not properly work on your setup.

Should I download fs library or is it from jquery?

It’s hard to help you in this case, since fs should be part of node as core module and be available at any case (except you are working inside the browser, where fs is not available).

On which environment are you operating?

Which node version are you using?

node -v

What has jquery to do with that?

I have node v8.11.4
I am executing in command prompt in windows
I am able to execute all the example projects but not this one
I am creating bpmn diagram from java using jaxb, only issue is to fill x y co-ordinates. so thought to check how this auto layout works.

I’d recommend upgrading your node installation, since it is deprecated.

fs promises are also not supported in those early node versions. That’s why it’s crashing on your machine.

2 Likes

Please also note our warning banner for this project

image

Thanks for the suggestion. NodeJs update fixed the issue.