0

I would like to use the javascript API Stylus offers in my Spine app.

To do this, I have to require Stylus.

Because Stylus is a dependency of Hem I tried requiring it in the index.coffee:

Stylus    ?= require('stylus')

But this resulted in an error:

uncaught exception: module Stylus not found

Then I tried including Stylus independently in the package.json

{
  "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"
  }
}

And in my 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": []
}

But this resulted in an error in the server log:

Unhandled error!

How can I require Stylus and make use of its API in Spine?

Nina
  • 23
  • 4

1 Answers1

0

I feel like you forgot to run npm install after adding the stylus dependency into your app package.json.

Delapouite
  • 9,469
  • 5
  • 36
  • 41
  • I ran npm install. I can also see a **stylus** folder in my **node_modules** folder. I think the problem could be that stylus is dependent on hem. I can also see a **stylus** folder inside the **node_modules** folder of **hem**. But I dont know how to require this in my slug.json. – Nina Jun 08 '12 at 16:59
  • I got the following output when I ran npm install: `stylus@0.22.6 ./node_modules/stylus ├── growl@1.1.0 ├── mkdirp@0.0.7 └── cssom@0.2.1` – Nina Jun 08 '12 at 17:00