danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 481 forks source link

Cannot find module 'coffee-script', ...'stylus' #89

Closed kadishmal closed 9 years ago

kadishmal commented 9 years ago

Node.js version 0.10.32.

My package.json:

{
    ...
    "aglio": "~1.17.1",
    ...
}

test.js:

var aglio = require('aglio');

aglio.render(content, 'default-collapsible', cb);

Shows:

{
  "code": "MODULE_NOT_FOUND",
  "line": 228,
  "filename": "/openapi/node_modules/aglio/templates/_bootstrap-mixins.jade",
  "path": "/openapi/node_modules/aglio/templates/_bootstrap-mixins.jade",
  "status": 500,
  "error": "MODULE_NOT_FOUND",
  "error_description": "/openapi/node_modules/aglio/templates/_bootstrap-mixins.jade:228\n\n\nCannot find module 'coffee-script'"
}

Why should I add coffee-script to my package.json?

{
    ...
    "aglio": "~1.17.1",
    "coffee-script": "~1.9.1",
    ...
}

Then it shows:

{
  "code": "MODULE_NOT_FOUND",
  "line": 16,
  "filename": "/openapi/node_modules/aglio/templates/_bootstrap-layout.jade",
  "path": "/openapi/node_modules/aglio/templates/_bootstrap-layout.jade",
  "status": 500,
  "error": "MODULE_NOT_FOUND",
  "error_description": "/openapi/node_modules/aglio/templates/_bootstrap-layout.jade:16\n\n\nCannot find module 'stylus'"
}

Basically it cannot find any of the aglio modules.

This started to happen only after upgrading from aglio version ~1.14.0 to ~1.17.1.

The following is the dependency list of ~1.14.0 working version.

$ npm list
openapi@1.3.0 /openapi
├─┬ aglio@1.14.0
│ ├─┬ cli-color@0.2.3
│ │ ├── es5-ext@0.9.2
│ │ └─┬ memoizee@0.2.6
│ │   ├── event-emitter@0.2.2
│ │   └── next-tick@0.1.0
│ ├─┬ coffee-script@1.7.1
│ │ └── mkdirp@0.3.5
│ ├── highlight.js@8.0.0
│ ├─┬ jade@1.3.1
│ │ ├── character-parser@1.2.0
│ │ ├── commander@2.1.0
│ │ ├─┬ constantinople@2.0.1
│ │ │ └─┬ uglify-js@2.4.17
│ │ │   ├── async@0.2.10
│ │ │   ├─┬ source-map@0.1.34
│ │ │   │ └── amdefine@0.1.0
│ │ │   ├── uglify-to-browserify@1.0.2
│ │ │   └── yargs@1.3.3
│ │ ├── mkdirp@0.3.5
│ │ ├─┬ monocle@1.1.51
│ │ │ └─┬ readdirp@0.2.5
│ │ │   └─┬ minimatch@2.0.4
│ │ │     └─┬ brace-expansion@1.1.0
│ │ │       ├── balanced-match@0.2.0
│ │ │       └── concat-map@0.0.1
│ │ ├─┬ transformers@2.1.0
│ │ │ ├─┬ css@1.0.8
│ │ │ │ ├── css-parse@1.0.4
│ │ │ │ └── css-stringify@1.0.5
│ │ │ ├─┬ promise@2.0.0
│ │ │ │ └── is-promise@1.0.1
│ │ │ └─┬ uglify-js@2.2.5
│ │ │   ├─┬ optimist@0.3.7
│ │ │   │ └── wordwrap@0.0.2
│ │ │   └─┬ source-map@0.1.43
│ │ │     └── amdefine@0.1.0
│ │ └─┬ with@3.0.1
│ │   └─┬ uglify-js@2.4.17
│ │     ├── async@0.2.10
│ │     ├─┬ source-map@0.1.34
│ │     │ └── amdefine@0.1.0
│ │     ├── uglify-to-browserify@1.0.2
│ │     └── yargs@1.3.3
│ ├── marked@0.3.3
│ ├── moment@2.6.0
│ ├─┬ optimist@0.6.1
│ │ ├── minimist@0.0.10
│ │ └── wordwrap@0.0.2
│ ├── protagonist@0.10.0
│ └─┬ stylus@0.43.1
│   ├── css-parse@1.7.0
│   ├─┬ debug@2.1.2
│   │ └── ms@0.7.0
│   ├─┬ glob@3.2.11
│   │ ├── inherits@2.0.1
│   │ └─┬ minimatch@0.3.0
│   │   ├── lru-cache@2.5.0
│   │   └── sigmund@1.0.0
│   ├── mkdirp@0.3.5
│   └── sax@0.5.8

Here is the dependency list of ~1.17.1 broken version.

├─┬ aglio@1.17.1
│ ├─┬ chokidar@0.12.6
│ │ ├── async-each@0.1.6
│ │ └─┬ readdirp@1.3.0
│ │   ├── graceful-fs@2.0.3
│ │   ├─┬ minimatch@0.2.14
│ │   │ ├── lru-cache@2.5.0
│ │   │ └── sigmund@1.0.0
│ │   └─┬ readable-stream@1.0.33
│ │     ├── core-util-is@1.0.1
│ │     ├── inherits@2.0.1
│ │     ├── isarray@0.0.1
│ │     └── string_decoder@0.10.31
│ ├─┬ cli-color@0.3.2
│ │ ├── d@0.1.1
│ │ ├─┬ es5-ext@0.10.6
│ │ │ ├── es6-iterator@0.1.3
│ │ │ └── es6-symbol@2.0.1
│ │ ├─┬ memoizee@0.3.8
│ │ │ ├─┬ es6-weak-map@0.1.2
│ │ │ │ ├─┬ es6-iterator@0.1.3
│ │ │ │ │ └── es6-symbol@2.0.1
│ │ │ │ └── es6-symbol@0.1.1
│ │ │ ├── event-emitter@0.3.3
│ │ │ ├── lru-queue@0.1.0
│ │ │ └── next-tick@0.2.2
│ │ └─┬ timers-ext@0.1.0
│ │   └── next-tick@0.2.2
│ ├── coffee-script@1.9.1
│ ├── highlight.js@8.4.0
│ ├── protagonist@0.17.2
│ ├─┬ remarkable@1.6.0
│ │ ├─┬ argparse@0.1.16
│ │ │ ├── underscore@1.7.0
│ │ │ └── underscore.string@2.4.0
│ │ └── autolinker@0.15.2
│ ├─┬ socket.io@1.3.5
│ │ ├─┬ debug@2.1.0
│ │ │ └── ms@0.6.2
│ │ ├─┬ engine.io@1.5.1
│ │ │ ├── base64id@0.1.0
│ │ │ ├─┬ debug@1.0.3
│ │ │ │ └── ms@0.6.2
│ │ │ ├─┬ engine.io-parser@1.2.1
│ │ │ │ ├── after@0.8.1
│ │ │ │ ├── arraybuffer.slice@0.0.6
│ │ │ │ ├── base64-arraybuffer@0.1.2
│ │ │ │ ├── blob@0.0.2
│ │ │ │ ├─┬ has-binary@0.1.5
│ │ │ │ │ └── isarray@0.0.1
│ │ │ │ └── utf8@2.0.0
│ │ │ └─┬ ws@0.5.0
│ │ │   ├── nan@1.4.3
│ │ │   ├── options@0.0.6
│ │ │   └── ultron@1.0.1
│ │ ├─┬ has-binary-data@0.1.3
│ │ │ └── isarray@0.0.1
│ │ ├─┬ socket.io-adapter@0.3.1
│ │ │ ├─┬ debug@1.0.2
│ │ │ │ └── ms@0.6.2
│ │ │ ├── object-keys@1.0.1
│ │ │ └─┬ socket.io-parser@2.2.2
│ │ │   ├── benchmark@1.0.0
│ │ │   ├── component-emitter@1.1.2
│ │ │   ├── debug@0.7.4
│ │ │   ├── isarray@0.0.1
│ │ │   └── json3@3.2.6
│ │ ├─┬ socket.io-client@1.3.5
│ │ │ ├── backo2@1.0.2
│ │ │ ├── component-bind@1.0.0
│ │ │ ├── component-emitter@1.1.2
│ │ │ ├── debug@0.7.4
│ │ │ ├─┬ engine.io-client@1.5.1
│ │ │ │ ├── component-inherit@0.0.3
│ │ │ │ ├─┬ debug@1.0.4
│ │ │ │ │ └── ms@0.6.2
│ │ │ │ ├─┬ engine.io-parser@1.2.1
│ │ │ │ │ ├── after@0.8.1
│ │ │ │ │ ├── arraybuffer.slice@0.0.6
│ │ │ │ │ ├── base64-arraybuffer@0.1.2
│ │ │ │ │ ├── blob@0.0.2
│ │ │ │ │ ├─┬ has-binary@0.1.5
│ │ │ │ │ │ └── isarray@0.0.1
│ │ │ │ │ └── utf8@2.0.0
│ │ │ │ ├─┬ has-cors@1.0.3
│ │ │ │ │ └── global@2.0.1
│ │ │ │ ├─┬ parsejson@0.0.1
│ │ │ │ │ └─┬ better-assert@1.0.2
│ │ │ │ │   └── callsite@1.0.0
│ │ │ │ ├─┬ parseqs@0.0.2
│ │ │ │ │ └─┬ better-assert@1.0.2
│ │ │ │ │   └── callsite@1.0.0
│ │ │ │ ├─┬ parseuri@0.0.4
│ │ │ │ │ └─┬ better-assert@1.0.2
│ │ │ │ │   └── callsite@1.0.0
│ │ │ │ ├─┬ ws@0.4.31
│ │ │ │ │ ├── commander@0.6.1
│ │ │ │ │ ├── nan@0.3.2
│ │ │ │ │ ├── options@0.0.6
│ │ │ │ │ └── tinycolor@0.0.1
│ │ │ │ └── xmlhttprequest@1.5.0
│ │ │ ├─┬ has-binary@0.1.6
│ │ │ │ └── isarray@0.0.1
│ │ │ ├── indexof@0.0.1
│ │ │ ├── object-component@0.0.3
│ │ │ ├─┬ parseuri@0.0.2
│ │ │ │ └─┬ better-assert@1.0.2
│ │ │ │   └── callsite@1.0.0
│ │ │ └── to-array@0.1.3
│ │ └─┬ socket.io-parser@2.2.4
│ │   ├── benchmark@1.0.0
│ │   ├── component-emitter@1.1.2
│ │   ├── debug@0.7.4
│ │   ├── isarray@0.0.1
│ │   └── json3@3.2.6
│ ├─┬ stylus@0.49.3
│ │ ├── css-parse@1.7.0
│ │ ├─┬ debug@2.1.2
│ │ │ └── ms@0.7.0
│ │ ├─┬ glob@3.2.11
│ │ │ ├── inherits@2.0.1
│ │ │ └─┬ minimatch@0.3.0
│ │ │   ├── lru-cache@2.5.0
│ │ │   └── sigmund@1.0.0
│ │ ├── mkdirp@0.3.5
│ │ ├── sax@0.5.8
│ │ └─┬ source-map@0.1.43
│ │   └── amdefine@0.1.0
│ └── yargs@1.3.3

By the way, when installing ~1.17.1, npm shows the following warning:

npm WARN optional dep failed, continuing fsevents@0.3.5

fsevents, available only on OS X, is used by chokidar, though optionally.

Can anybody help?

danielgtaylor commented 9 years ago

The fsevents error is no problem (since it's optional and only affect Mac OS X). It seems that we may need to use peer dependencies for these other modules though. I'll look into this and see what I can come up with.

Quantium commented 9 years ago

Same issue for me

danielgtaylor commented 9 years ago

@kadishmal @Quantium this should be resolved in the latest beta release. Can you try to install via npm install aglio@beta and let me know if you still have issues?

danielgtaylor commented 9 years ago

This should now be fixed in the latest stable release, version 2.0. Thanks!