0

I want to run bpmn in localhost. After browsing whole day, I tried this steps

  1. install nodejs
  2. npm install bpmn-js // in cmd

After this don't know want to do.

also tried

  1. downloading bpmn example files
  2. saved it in local path and opened "localhost/bpmn-js-examples-master/properties-panel/app" in chrome.

and getting error in console => "Uncaught ReferenceError: require is not defined"

To solve this I have include require.js file to index.html ( inside "localhost/bpmn-js-examples-master/properties-panel/app" )

but now getting new console error => "Uncaught Error: Module name "fs" has not been loaded yet for context: _. Use require([])"

Please, anyone help me with this.

Vegeta
  • 1,319
  • 7
  • 17

2 Answers2

1

From their github:

Make sure you use browserify or the like to bundle your project and bpmn-js for the browser.

There is also a sample project provided for node environment. You can use the sample and build around it. The important part you're missing is the grunt script browserifying your code (this process prevents the require is not defined error).

Shanoor
  • 13,344
  • 2
  • 29
  • 40
  • I have installed browserify. Still getting "require" error. I have no idea how to do it, can you please explain step by step. – Vegeta Jan 29 '16 at 05:06
  • Thanks, your answer gave me the idea to solve it. +1 – Vegeta Jan 29 '16 at 06:17
  • @Vegeta I don't use Grunt much but according to the github page, running `grunt auto-build` will watch your files, auto-browserify them and will run a webserver for testing. The "compiled" files are inside a `dist` folder. – Shanoor Jan 29 '16 at 06:42
1

I got answer after getting idea from ShanShan's answer.

Steps to run BPMN.IO in localhost is

  1. Download bpmn example files and save it in localhost directory
  2. Install nodejs
  3. Open cmd and go to the path where you want to run BPMN ( example: cd c:/.../bpmn-js-examples-master/properties-panel/app. Here you will see 3 files index.js, index.html, css folder )
  4. Install browserify using command => npm install browserify ( without changing path )
  5. Then run => browserify index.js -o bundle.js or browserify -t brfs index.js > bundle.js according to requirement. see Stackoverflow answer of Substack

    5.1 if got error like "brfs module missing" then execute => npm install brfs

    5.2 if got error like "xxxx module missing" then execute => npm install xxxx ( till all module installed)

  6. After this bundle.js file is created in the same path.
  7. Open index.html in editor and replace index.js with bundle.js in script tag.
  8. open index.html in browser.
Community
  • 1
  • 1
Vegeta
  • 1,319
  • 7
  • 17
  • cd c:/.../bpmn-js-examples-master/properties-panel/app npm install browserify I am trying this command on npm cmd, It won't work please give me solution how to install browserify – Rahul Giradkar Aug 29 '16 at 06:13
  • After this I got an error like " bundle.js:5092 Uncaught TypeError: fs.readFileSync is not a function " Please help me how resolve this error. – Rahul Giradkar Aug 29 '16 at 10:53