开发者

How can I add dependencies to my Spine app?

I'm tryin开发者_C百科g 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?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜