vasturiano / d3-force-3d

Force-directed graph layout in 1D, 2D or 3D using velocity Verlet integration.
https://observablehq.com/@vasturiano/multi-dimensional-d3-force-simulation
MIT License
369 stars 52 forks source link

Cannot compile #8

Closed noorbakerally closed 4 years ago

noorbakerally commented 4 years ago

I am getting an error when compiling:

static/js/main.f65c36cd.js from UglifyJs SyntaxError: Unexpected token: operator (>) [./~/d3-force-3d/dist/d3-force-3d.js:245,0]

npm ERR! Linux 4.15.0-70-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! ui@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ui@0.1.0 build script 'react-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
vasturiano commented 4 years ago

@noorbakerally I think you are trying to minify ES6 code in this library using uglify, which only supports ES5 syntax I believe. You can solve it by switching to terser, or pre-transpiling down to ES5 before minifying.

As for more info on why the module exposes ES6 code, please see https://github.com/d3/d3-force/issues/134