1

I'm trying to make a new spine javascript app using d3 (generated using Spine.app). I tried the following:

  1. Edit slug.json, and add "d3" to the dependencies array.
  2. Run "npm install ."
  3. Run "hem build"

Hem complains:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Cannot find module: d3. Have you run `npm install .` ?

I've tried manually adding d3 to package.json and I've tried manually installing d3 using "npm install -g d3". But I still get the same error.

Any pointers? How do I add dependencies to my spine project?

VividD
  • 10,456
  • 6
  • 64
  • 111
dsummersl
  • 6,588
  • 50
  • 65

2 Answers2

1

Make sure you reference the full path to the d3.js file, then run "npm install ."

joelvh
  • 16,700
  • 4
  • 28
  • 20
1

The answer was that the 'd3' module did not reference its 'main' js file in its package. So in order to install d3 in my spine app I had to do two things:

reference 'd3/d3' in my slug.json file.
reference d3 as "d3": "~2.3.2" in my package.json file.

This should be fixed in 2.5.0 of d3 - I opened a defect with the d3 owner and he emailed me that he fixed it yesterday.

dsummersl
  • 6,588
  • 50
  • 65