fixes broken npm install

#1 Declined
Repository
boneskull
Branch
default
Repository
jacob4u2
Branch
default
Author
  1. Christopher Hiller
Reviewers
Description

When you install node-hg via "npm install", you get a package full of .coffee files.

Anyway, you basically just have to add "install": "node_modules/.bin/coffee -b -c lib" to your "scripts" object in package.json.

However, best practice (from what I understand) means packaging the .js files in your lib/ dir, and putting the .coffee files in src/ or something.

Also I can squash these commits, but I'm not sure how to do that.

Comments (6)

  1. Jacob Gable repo owner

    This is not broken. When you require this module, it requires index.js from the root which requires coffee-script and then requires the coffee script files in /lib. This is transparent to the consumer; meaning, you do not need to require coffee-script yourself as a dependency.

    To test this you could have just looked at the example code in the README and put it verbatim into your project. Notice it is not written in coffee script and doesn't require your code to install coffee-script.

  2. Christopher Hiller author

    I beg to differ:

    [chiller@lectroid:~/tmp]$ npm install hg
    npm http GET https://registry.npmjs.org/hg
    npm http 304 https://registry.npmjs.org/hg
    npm http GET https://registry.npmjs.org/coffee-script
    npm http GET https://registry.npmjs.org/winston
    npm http GET https://registry.npmjs.org/uuid
    npm http GET https://registry.npmjs.org/lodash
    npm http 304 https://registry.npmjs.org/coffee-script
    npm http 304 https://registry.npmjs.org/uuid
    npm http 304 https://registry.npmjs.org/winston
    npm http 200 https://registry.npmjs.org/lodash
    npm http GET https://registry.npmjs.org/mkdirp
    npm http GET https://registry.npmjs.org/async
    npm http GET https://registry.npmjs.org/colors
    npm http GET https://registry.npmjs.org/eyes
    npm http GET https://registry.npmjs.org/cycle
    npm http GET https://registry.npmjs.org/pkginfo
    npm http GET https://registry.npmjs.org/request
    npm http GET https://registry.npmjs.org/stack-trace
    npm http 304 https://registry.npmjs.org/mkdirp
    npm http 304 https://registry.npmjs.org/cycle
    npm http 304 https://registry.npmjs.org/colors
    npm http 304 https://registry.npmjs.org/async
    npm http 304 https://registry.npmjs.org/eyes
    npm http 304 https://registry.npmjs.org/request
    npm http 304 https://registry.npmjs.org/stack-trace
    npm http 304 https://registry.npmjs.org/pkginfo
    npm http GET https://registry.npmjs.org/form-data
    npm http GET https://registry.npmjs.org/mime
    npm http GET https://registry.npmjs.org/node-uuid
    npm http GET https://registry.npmjs.org/cookie-jar
    npm http GET https://registry.npmjs.org/oauth-sign
    npm http GET https://registry.npmjs.org/aws-sign
    npm http GET https://registry.npmjs.org/hawk
    npm http GET https://registry.npmjs.org/forever-agent
    npm http GET https://registry.npmjs.org/tunnel-agent
    npm http GET https://registry.npmjs.org/json-stringify-safe
    npm http GET https://registry.npmjs.org/qs
    npm http 304 https://registry.npmjs.org/form-data
    npm http 304 https://registry.npmjs.org/aws-sign
    npm http 304 https://registry.npmjs.org/oauth-sign
    npm http 304 https://registry.npmjs.org/cookie-jar
    npm http 304 https://registry.npmjs.org/node-uuid
    npm http 304 https://registry.npmjs.org/hawk
    npm http 304 https://registry.npmjs.org/forever-agent
    npm http 304 https://registry.npmjs.org/tunnel-agent
    npm http 304 https://registry.npmjs.org/json-stringify-safe
    npm http 304 https://registry.npmjs.org/qs
    npm http 200 https://registry.npmjs.org/mime
    npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.26","npm":"1.4.3"})
    npm http GET https://registry.npmjs.org/combined-stream
    npm http GET https://registry.npmjs.org/hoek
    npm http GET https://registry.npmjs.org/boom
    npm http GET https://registry.npmjs.org/cryptiles
    npm http GET https://registry.npmjs.org/sntp
    npm http 304 https://registry.npmjs.org/combined-stream
    npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
    npm http 304 https://registry.npmjs.org/hoek
    npm http 304 https://registry.npmjs.org/cryptiles
    npm http 304 https://registry.npmjs.org/sntp
    npm http 304 https://registry.npmjs.org/boom
    npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.26","npm":"1.4.3"})
    npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.26","npm":"1.4.3"})
    npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.26","npm":"1.4.3"})
    npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.26","npm":"1.4.3"})
    npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
    hg@0.0.4 node_modules/hg
    ├── uuid@1.4.1
    ├── lodash@2.4.1
    ├── coffee-script@1.7.1 (mkdirp@0.3.5)
    └── winston@0.7.2 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, colors@0.6.2, async@0.2.10, pkginfo@0.3.0, request@2.16.6)
    [chiller@lectroid:~/tmp]$ node
    > require('hg')
    Error: Cannot find module './lib'
      at Function.Module._resolveFilename (module.js:338:15)
      at Function.Module._load (module.js:280:25)
      at Module.require (module.js:364:17)
      at require (module.js:380:17)
      at Object.<anonymous> (/Users/chiller/tmp/node_modules/hg/index.js:3:18)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Module.require (module.js:364:17)
      at require (module.js:380:17)
      at repl:1:2
      at REPLServer.self.eval (repl.js:110:21)
      at Interface.<anonymous> (repl.js:239:12)
      at Interface.EventEmitter.emit (events.js:95:17)
      at Interface._onLine (readline.js:202:10)
      at Interface._line (readline.js:531:8)
      at Interface._ttyWrite (readline.js:760:14)
      at ReadStream.onkeypress (readline.js:99:10)
      at ReadStream.EventEmitter.emit (events.js:98:17)
      at emitKey (readline.js:1095:12)
      at ReadStream.onData (readline.js:840:14)
      at ReadStream.EventEmitter.emit (events.js:95:17)
      at ReadStream.<anonymous> (_stream_readable.js:746:14)
      at ReadStream.EventEmitter.emit (events.js:92:17)
      at emitReadable_ (_stream_readable.js:408:10)
      at emitReadable (_stream_readable.js:404:5)
      at readableAddChunk (_stream_readable.js:165:9)
      at ReadStream.Readable.push (_stream_readable.js:127:10)
      at TTY.onread (net.js:528:21)
    

    For comparison:

    [chiller@lectroid:~/tmp]$ npm install rimraf
    npm http GET https://registry.npmjs.org/rimraf
    npm http 304 https://registry.npmjs.org/rimraf
    rimraf@2.2.6 node_modules/rimraf
    [chiller@lectroid:~/tmp]$ node
    > require('rimraf')
    { [Function: rimraf] sync: [Function: rimrafSync] }