如何向我的 Spine 应用程序添加依赖项?
我正在尝试使用 d3 (使用 Spine.app 生成)制作一个新的 spin javascript 应用程序。我尝试了以下操作:
- 编辑 slug.json,并将“d3”添加到依赖项数组中。
- 运行“npm install”。
- 运行“hem build”
Hem 抱怨:
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Cannot find module: d3. Have you run `npm install .` ?
我尝试过手动将 d3 添加到 package.json,并且尝试使用“npm install -g d3”手动安装 d3。但我仍然遇到同样的错误。
有什么指点吗?如何向我的脊柱项目添加依赖项?
I'm trying to make a new spine javascript app using d3 (generated using Spine.app). I tried the following:
- Edit slug.json, and add "d3" to the dependencies array.
- Run "npm install ."
- 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保引用 d3.js 文件的完整路径,然后运行“npm install”。
Make sure you reference the full path to the d3.js file, then run "npm install ."
答案是“d3”模块没有在其包中引用其“main”js 文件。因此,为了在我的脊柱应用程序中安装 d3,我必须做两件事:
这应该在 d3 的 2.5.0 中修复 - 我向 d3 所有者打开了一个缺陷,他通过电子邮件告诉我他昨天修复了它。
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:
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.