我想在我的Spine应用中使用javascript API Stylus优惠。
要做到这一点,我必须要求Stylus。
因为Stylus是Hem的依赖项,我尝试在index.coffee中使用它:
Stylus ?= require('stylus')
但这导致了一个错误:
uncaught exception: module Stylus not found
然后我尝试在package.json
中独立包含Stylus{
"name": "Blank",
"version": "0.0.1",
"engines": {
"node": "0.6.x",
"npm": "1.0.x"
},
"dependencies": {
"serveup": "~0.0.2",
"hem": "~0.1.7",
"stylus" : "~0.22.6",
"es5-shimify": "~0.0.1",
"json2ify": "~0.0.1",
"jqueryify": "~0.0.1",
"spine": "~1.0.5",
"spine.mobile": "~1.0.0",
"gfx": "~0.0.4"
}
}
在我的slug.json
中{
"dependencies": [
"es5-shimify",
"json2ify",
"jqueryify",
"spine",
"spine/lib/local",
"spine/lib/ajax",
"spine/lib/relation",
"spine/lib/route",
"spine/lib/tmpl",
"spine/lib/manager",
"stylus"
],
"libs": []
}
但这导致服务器日志出错:
Unhandled error!
如何在Spine中使用Stylus并使用其API?
答案 0 :(得分:0)
我觉得您在将手写笔依赖项添加到app package.json后忘记运行npm install
。